Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

How can I share data among projects under Xcode?

in Questions Posts: 21

The function of "GlobalData" seems the way to share data among projexts under Codea. But I am looking for a way to share data among the projects under Xcode environment as the Apple Apps. Is there any way to read and write data to Global memory of iPad. As Codea has "pasteboard.copy" commnd, I can export data to system pasteboard. Is there any way to copy from the pasteboard?

Comments

  • dave1707dave1707 Mod
    Posts: 7,049

    Using pasteboard.text gets text out of pasteboard.

    function setup()
        pasteboard.copy("Hello world")
        a=pasteboard.text
        print(a)
    end
    
  • dave1707dave1707 Mod
    Posts: 7,049

    Here’s an example. Run this code and then open notes. Select a range of text in notes and tap on copy. Go back to the running Codea code and the selected text will print in Codea.

    ~~~
    function setup()
    end

    function draw()
    background(40, 40, 50)
    a=pasteboard.text
    if a~="" then
    print(a)
    pasteboard.copy("")
    end
    end

Sign In or Register to comment.