Been starting to work with Core Data a bit, and while I've figured out how to use it in regular Cocoa applications, it seems it works a bit differently in Cocoa Touch. How do you bind entities to objects such as table cells in Cocoa Touch?
相关问题
- Core Data lightweight migration crashes after App
- Image loads in simulator but not device?
- Can two managed object context share one single pe
- NSOutlineView drag line stuck + blue border
- UIModalTransitionStyleFlipHorizontal flips Vertica
相关文章
- Xcode: Is there a way to change line spacing (UI L
- Converting (u)int64_t to NSNumbers
- Can keyboard of type UIKeyboardTypeNamePhonePad be
- “getter” keyword in @property declaration in Objec
- How to get a CGImageRef from Context-Drawn Images?
- Generate code for core data attributes in xcode 4
- NSMenuItem KeyEquivalent “ ”(space) bug
- Why are my UIView layer properties not being set w
Unfortunately, bindings are not supported in the iPhone OS. See this page in the Apple developer docs.
I believe this means that you can't use the NSArrayController in the iPhone OS.
If you're using CoreData on iPhone OS 3.0 and above, you'll want to look at
NSFetchedResultsController
. While not really an analog toNSArrayController
, it is designed specifically to be used withUITableView
and its controller.It provides a way to load elements from persistence as needed, keeping in mind performance and memory constraints of the device. It's not as clean as simply binding things, but it will probably do everything you need (and more!) with a small amount of code.
Jergason is correct: you can not use bindings or the NSArrayController with Core Data on the iPhone.
Instead, check out NSFetchedResultsController which "is intended to efficiently manage the results returned from a Core Data fetch request to provide data for a UITableView object."