Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

liptonlover

macrumors 6502a
Original poster
Mar 13, 2008
989
0
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?
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
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
 

Attachments

  • ScrollSelected.png
    ScrollSelected.png
    30.5 KB · Views: 270
  • TextSelected.png
    TextSelected.png
    31.8 KB · Views: 264

liptonlover

macrumors 6502a
Original poster
Mar 13, 2008
989
0
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:
 

liptonlover

macrumors 6502a
Original poster
Mar 13, 2008
989
0
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 :)
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
"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 :)

Sounds like a Core Data issue. Possibly it launched an older version of your app kicking around somewhere on the file system?
 

liptonlover

macrumors 6502a
Original poster
Mar 13, 2008
989
0
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:
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.