scroll view value binding

Discussion in 'Mac Programming' started by liptonlover, Jun 26, 2008.

  1. macrumors 6502a

    Joined:
    Mar 13, 2008
    #1
    I'm working with core data, learning how to use it. I can bind the value of a text field to an attribute. But scroll view, though it is in essence just a text field, does not have a value binding option. How do I bind its value?
     
  2. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    A NSScrollView is not a text field or anything like one.

    A NSScrollView contains an NSClipView. The NSClipView contains the view you are scrolling around. So when you drag that NSTextView from the IB palette you are getting 3 views all one within each other. Double click on the NSScrollView (just inside the top-left) until you get the actual text view selected. Then you can bind it's content.

    Edit: I've added some pictures of how it looks in each mode. The first is the NSScrollView selected, the second is after double clicking with the NSTextView selected
     

    Attached Files:

  3. thread starter macrumors 6502a

    Joined:
    Mar 13, 2008
    #3
    Results:

    closest matches to "value"

    valueurl (does nothing)

    value path (does nothing)

    data (does nothing)

    attributed string (works as long as conditionally sets editable is unchecked, except that when I try opening the saved data it gives an error sometihng along the lines of "tried opening document that doesn't match persistent data model" or something like that.)


    None of the views have a "value" binding option. :mad:
     
  4. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
  5. thread starter macrumors 6502a

    Joined:
    Mar 13, 2008
    #5
    getting closer....

    I unchecked rich text. It allowed me to bind the value. But when I built the program, I couldn't edit the text. So I went back and under value bindings I unchecked "conditionally sets editable" (the textfield's editable attribute was on) I built it again, and I was able to edit. I saved a random document, and closed the app. When I double clicked on the saved file though, here's the error I got: (it didn't open the document)

    "The document “sgfd” could not be opened. The managed object model version used to open the persistent store is incompatible with the one that was used to create the persistent store."

    Thanks for your help so far :)
     
  6. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #6
    Sounds like a Core Data issue. Possibly it launched an older version of your app kicking around somewhere on the file system?
     
  7. thread starter macrumors 6502a

    Joined:
    Mar 13, 2008
    #7
    it was trying to open another of my applications, one that had a custom file type. But when I open it in my new application the textfield is empty even though I make sure to save it with text in it.:confused:
     

Share This Page