I have a view that will be used in each of my CollectionView elements. I have an IBOutlet for CollectionViewItem from my view and I connected to it in Interface Builder. I want to access a value from a createdObject (which is a Core Data object) in my view code. Here is an example of what I'm trying to do - access the sequence value of the represented object:
In the .h file:
IBOutlet NSCollectionViewItem *item;
In the .m file
NSString *seq = [[item representedObject] valueForKey:@"seq"]; NSLog(@"Seq: %@", seq);
I know that seq is populated because I linked it to a label in the CollectionViewItem in IB using the key path presentationObject.seq, and it works.
Any idea why, when I try to access the value for seq in the code for the view, it returns null?
objective-c cocoa cocoa-bindings nscollectionview
Austin
source share