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 16:36:41 -0500
- Organization: JTA Enterprises LLC
> >
> > // generic
> > NSManagedObject someObject = [NSEntityDescription insert...];
> > (anEntity *)someObject.attribute = @"somevalue";
>
> Same here, I don't know if this must be seen as a bug or not. This
> works for me :
>
> ((anEntity *)someObject).attribute = @"somevalue";
>
> Frédéric=
[Jon C. Munson II] Thanks to Wim as well for the reply.
I decided to try and (since it worked) then go with the explicit route,
since I was mostly there anyway.
I added @class anEntity to the .h file.
I added #import "anEntity" to the .m file.
I then changed my insert statement to:
anEntity *thisObject = [NSEntityDescription insert...];
thisObject.attribute = @"somevalue";
After looking at the generic version (at top) and realizing that I had
pulled in the class info anyway, I saw no value (for what I'm doing) to
continue that approach, hence the explicit approach just above.
If that's not good, do let me know.
Thanks for all the answers and input!
Peace, Love, and Light,
/s/ Jon C. Munson II
_______________________________________________
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