RE: Populating a new SQLite Core Data store with default data
RE: Populating a new SQLite Core Data store with default data
- Subject: RE: Populating a new SQLite Core Data store with default data
- From: "Jon C. Munson II" <email@hidden>
- Date: Mon, 23 Feb 2009 14:09:18 -0500
- Organization: JTA Enterprises LLC
> > After some brief testing, if one creates entities of NSManagedObject
> > thus:
> > NSManagedObject *someObject = [NSEntityDescription insert...];
> > one most likely cannot use the dot syntax accessors [...]
> >
> This is not the case if you follow the patterns described in the
> documentation:
> <http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articl
> es/cdAccessorMethods.html
> >
>
[Jon C. Munson II] Here's what I tried:
NSManagedObject *someObject = [NSEntityDescription insert...];
someObject.attribute = @"";
and also:
NSManagedObject *someObject = [NSEntityDescription insert...];
[someObject setAttribute:@""];
Neither would work.
Feel free to show me the correct way as I don't see it in the dox. Again,
the samples I can readily find, given this particular circumstance, use KVC
to set the attribute values and that works just fine.
Kyle mentioned something about casting. While I know what certain casting
is, (int)i for example, I'm not sure what he meant. If he meant to include
the class header file and stipulate the class up front, etc., then I hadn't
done that as, again, the samples didn't cover that particular method for
this case - that was usually mentioned in the normal method, not the
convenience method being used here.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden