I recommend you to read "Core Data Programming Guide" from Apple Developer web 
site.

And go to "Fetching Managed Objects" this is a very important document you must 
have if you want to develop with core data.

What you will do is to perform a request with a predicate like 
NSPredicate * aPredicate = [NSPredicate predicateWithFormat: @"status == %@", 
statusToFind];

I also recommend you to search at the WWDC10 videos with "core Data" tag, there 
are also very good videos, where you can learn a lot of thing really fast.

My last recommendation is you store the status as Integer and set Index On, it 
will be much faster for core date to fetch the objects, 
Out of Stock = 1,
Low Stock = 2
In Stock = 3,

Good luck, 

Pablo
 

 
El 14/01/2011, a las 14:35, Amy Heavey escribió:

> I've got a core data app that has 2 entities, product and status, and a 
> relationship between them.
> 
> I'll be importing and updating some of the data in the app from csv files 
> supplied from an outside source. The 'status' is just given as a string. 
> There are 3 options, Low Stock, Out of Stock, and In Stock.
> 
> As I import, I can create new products, and set the attributes, and I think I 
> know how to set the relationship once the status is defined, but I need to 
> select it first.
> 
> I'm looking for something that does something like
> 
> [status selectObjectWithValue:@"Low Stock"]
> 
> or do I need to loop through the array each time. It's only a few but seems 
> excessive to loop through it?
> 
> Many Thanks
> 
> Amy
> 
> 
> 
> _______________________________________________
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/pablo.mailinglists%40gmail.com
> 
> This email sent to pablo.mailingli...@gmail.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to