-
Book Overview & Buying
-
Table Of Contents
Core Data iOS Essentials
The Core Data uses KVC to store and retrieve data from its managed objects. NSManagedObject supports the key value methods valueForKey: and setValue:forKey: for setting and retrieving attribute values from the managed object respectively.
The two key value methods that are widely used for setting and retrieving values of the attributes of the managed object are explained in the following sections.
The method -valueForKey: is a generic accessor to retrieve the specified attribute value from a managed object.
For example, let's say we have a managed object (Customer) and it has an attribute called name; we can obtain the value of the name attribute with the following:
NSString *custName = [managedObject valueForKey:@"name" ];
The value of the attribute name is retrieved from the managed object and is assigned to the NSString instance custName.
Similarly, the code used in the cellForRowAtIndexPath method in the RootViewController...
Change the font size
Change margin width
Change background colour