Re: Core Data - attribute to hold an array of strings
Re: Core Data - attribute to hold an array of strings
- Subject: Re: Core Data - attribute to hold an array of strings
- From: Shlok Datye <email@hidden>
- Date: Sun, 9 Aug 2009 10:18:13 +0000
Create an attribute of type "Binary Data". Encode your anArray of
strings into an NSData using something like "NSData *arrayData =
[NSArchiver archivedDataWithRootObject:anArray];". Finally, put
arrayData into the attribute.
Shlok Datye
Coding Turtle
http://codingturtle.com
On 09.08.2009, at 09:48, M.S. Hrishikesh wrote:
I created an Entity called MyPlaces. I want to store a number of
strings inside MyPlaces. How do I create an attribute to hold an
array of strings? I know how to create an Attribute to hold a single
string but I need to hold an array of strings.
One way is to create another Entity called PlaceName. PlaceName will
have an attribute of type String. I will then make a to-many
relationship from MyPlaces to PlaceName. But this seems way too
roundabout to solve my problem. Is there an easier way?
Thanks
Hrishi
_______________________________________________
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