Re: "Live" NSFetchRequest?

2016-09-24 Thread Chris Hanson
Are you asking about an NSFetchRequest that notices when objects are added to or changed in your persistent store by another process, or by another thread in the same process? In the latter case you can use the notifications posted by the NSManagedObjectContext that's being saved, and use

"Live" NSFetchRequest?

2016-09-17 Thread Frank D. Engel, Jr.
Before I go reinventing the wheel to try to code around this... Is there any way I can set up a "live" NSFetchRequest in a Core Data model, so that is matches against the predicate change (for example, predicate filters on a field, the value of that field changes such that an objec

Re: Core Data NSFetchRequest with predicate

2012-03-01 Thread Jerry Krinock
On 2012 Mar 01, at 18:52, M. S. Hrishikesh wrote: > NSString *key = @"tag"; > NSPredicate *pred = [NSPredicate predicateWithFormat:@"%K like > %@",key,@"personality"]; Well, what you're doing looks OK to me, but I'm not sure because I don't often use +predicateWithFormat:. Since you're appare

Core Data NSFetchRequest with predicate

2012-03-01 Thread M. S. Hrishikesh
Hi I have populated core data in my App with 10 entries. When I setup a fetch request with a predicate this way: --- NSString *key = @"tag"; NSPredicate *pred = [NSPredicate predicateWithFormat:@"%K like %@",key,@"personality"]; [req setPredicate:pred]; NSArray *results = [self.manag

Re: NSFetchRequest Problem Under iOS 4.3.5

2012-01-24 Thread Hunter Hillegas
I believe that initWithEntityName is new in iOS 5. On Jan 24, 2012, at 11:40 AM, Laurent Daudelin wrote: > NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] > initWithEntityName:@"Relationship"]; ___ Cocoa-dev mailing

Re: NSFetchRequest Problem Under iOS 4.3.5

2012-01-24 Thread Laurent Daudelin
Thanks, Dave, that did the trick! Maybe there could be an additional initializer for NSFetchRequest like initWithEntityName:inManagedObjectContext:... -Laurent. -- Laurent Daudelin AIM/iChat/Skype:LaurentDaudelin http://www.nemesys-soft.com/ Logiciels Nemesys

Re: NSFetchRequest Problem Under iOS 4.3.5

2012-01-24 Thread Dave DeLong
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"Relationship" inManagedObjectContext:context]; [fetchRequest setEntity:entity]; Dave On Jan 24, 2012, at 11:40 AM, Laurent Daudelin wrote: &

NSFetchRequest Problem Under iOS 4.3.5

2012-01-24 Thread Laurent Daudelin
Given the following code: NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] initWithEntityName:@"Relationship"]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%K = %@", @"parentObject.objectBaseUuid", wallUuid]; [fetch

Re: predicates and sort descriptors for NSFetchRequest - documentation is a bit vague

2011-12-14 Thread David Reed
On Dec 14, 2011, at 2:05 PM, Keary Suska wrote: > On Dec 14, 2011, at 11:07 AM, Dave Reed wrote: > >> Here's my sorting scenario with a few more details. >> >> Entity A (the one I'm fetching) has a to-one relation to Entity B with >> attribute b. Let's call the relation "tob" so my sort descri

Re: predicates and sort descriptors for NSFetchRequest - documentation is a bit vague

2011-12-14 Thread Keary Suska
On Dec 14, 2011, at 11:07 AM, Dave Reed wrote: > Here's my sorting scenario with a few more details. > > Entity A (the one I'm fetching) has a to-one relation to Entity B with > attribute b. Let's call the relation "tob" so my sort descriptor said > withKey:@"tob.b" and it results of the fetch

Re: predicates and sort descriptors for NSFetchRequest - documentation is a bit vague

2011-12-14 Thread Dave Reed
rtDescriptor as executed in an Objective-C context versus the subset of > of this functionality that Core data can translate into a SQL query as > described in the doc section "Store Types and Behaviors." > >> Can someone please elaborate on what kinds of predicates and s

Re: predicates and sort descriptors for NSFetchRequest - documentation is a bit vague

2011-12-14 Thread Keary Suska
e please elaborate on what kinds of predicates and sort descriptors > you can use when executing an NSFetchRequest using the NSManagedObjectContext > method: executeFetchRequest:error: ? The docs give guidelines, and there is a little more in the Predicate Programming Guide here: http:/

predicates and sort descriptors for NSFetchRequest - documentation is a bit vague

2011-12-14 Thread davelist
dicates and sort descriptors you can use when executing an NSFetchRequest using the NSManagedObjectContext method: executeFetchRequest:error: ? Thanks, Dave ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or mo

Re: Core Data - NSFetchRequest Issue

2011-01-13 Thread Jerry Krinock
On 2011 Jan 10, at 10:54, Joshua Lee Tucker wrote: > I am attempting to retrieve all of my Report objects, but when I retrieve > them, my array shows that I have also retrieved Locations objects. See -[NSFetchRequest setEntity:]. But if I recall correctly a fetch request will ra

Core Data - NSFetchRequest Issue

2011-01-13 Thread Joshua Lee Tucker
Hello, I have a small problem with NSFetchRequest. For some reason unknown to me, NSFetchRequest is not just returning my selected entity. I'll put this in context: I have two entities, one called Report and the other called Location. Report has a one-to-many relationship to Location,

Re: Using NSFetchRequest to fetch NSManagedObject subclasses

2010-07-11 Thread mmalc Crawford
On Jul 10, 2010, at 7:31 am, Matt James wrote: > That's absolutely right, though I'm glad Joanna chimed in since I didn't > know that was the common way to generate those classes to begin with (as I > said, I'm completely new to the workings of Core Data). > This technique is described in the in

Re: Using NSFetchRequest to fetch NSManagedObject subclasses

2010-07-11 Thread Joanna Carter
Hi Sean I tried this and found that most of its functionality is already present in Xcode. Also, the Autocustomize Entity Classes script doeszn't work in later versions of Xcode. Joanna -- Joanna Carter Carter Consulting ___ Cocoa-dev mailing list

Re: Using NSFetchRequest to fetch NSManagedObject subclasses

2010-07-10 Thread Sean McBride
Matt James (matteja...@gmail.com) on 2010-07-10 10:31 said: >After using this technique, I did have one more question related to >automated class generation. A much more automated solution is to use mogenerator: Sean __

Re: Using NSFetchRequest to fetch NSManagedObject subclasses

2010-07-10 Thread Joanna Carter
Hi Matt > After using this technique, I did have one more question related to automated > class generation. Xcode automatically tried to add the class files to the > AppName.xcdatamodeld directory. My initial assumption was that this was only > because I had it selected in the source list whe

Re: Using NSFetchRequest to fetch NSManagedObject subclasses

2010-07-10 Thread Keary Suska
On Jul 10, 2010, at 8:31 AM, Matt James wrote: > know that was the common way to generate those classes to begin with (as I > said, I'm completely new to the workings of Core Data). I don't know how "common" precisely, but very handy in certain situations, especially for those who hate KVC synt

Re: Using NSFetchRequest to fetch NSManagedObject subclasses

2010-07-10 Thread Matt James
On Sat, Jul 10, 2010 at 3:35 AM, Roland King wrote: > > On 10-Jul-2010, at 3:24 PM, Joanna Carter wrote: > > > Hi Matt > > > >> Wow, thank you so much. I have no idea how I missed the "Class" column > in the xcdatamodel's UI. From what I saw, none of the tutorials mentioned > doing this either.

Re: Using NSFetchRequest to fetch NSManagedObject subclasses

2010-07-10 Thread Roland King
On 10-Jul-2010, at 3:24 PM, Joanna Carter wrote: > Hi Matt > >> Wow, thank you so much. I have no idea how I missed the "Class" column in >> the xcdatamodel's UI. From what I saw, none of the tutorials mentioned >> doing this either. Maybe I was reading the newbie stuff where they didn't >

Re: Using NSFetchRequest to fetch NSManagedObject subclasses

2010-07-10 Thread Joanna Carter
Hi Matt > Wow, thank you so much. I have no idea how I missed the "Class" column in > the xcdatamodel's UI. From what I saw, none of the tutorials mentioned doing > this either. Maybe I was reading the newbie stuff where they didn't get into > fun stuff like that. I'm not sure why you would

Re: Using NSFetchRequest to fetch NSManagedObject subclasses

2010-07-09 Thread Matt James
Wow, thank you so much. I have no idea how I missed the "Class" column in the xcdatamodel's UI. From what I saw, none of the tutorials mentioned doing this either. Maybe I was reading the newbie stuff where they didn't get into fun stuff like that. Again, thanks a TON! -Matt On Jul 10, 201

Re: Using NSFetchRequest to fetch NSManagedObject subclasses

2010-07-09 Thread Roland King
Your model (xcdatamodel) says what class is used for each entity, you have that set to the name of your custom class, right? If so it will give you the correct object type when you insert or retrieve it. executeFetchRequest:error: in NSManagedObjectContext will return an NSArray() of the corre

Using NSFetchRequest to fetch NSManagedObject subclasses

2010-07-09 Thread Matt James
Hi all, In the WWDC session "Mastering Core Data", it was recommended to subclass NSManagedObject, which I'm doing. Not only does this follow their recommendation, but it's also helpful for coding additional logic that might be appropriate on a per-model basis. What I don't understand, howeve

NSFetchRequest with NSPredicate not fetches the expected objects (iPhone)

2010-02-24 Thread Giannandrea Castaldi
Hi, I'm developing an atom feed reader for iPhone and I'm trying to execute a NSFetchRequest with a NSPredicate in a test where the result should be an array with two objects but instead is emtpy. There are two entities: Feed (Atom feed) and Entry. In the model Entry has a relationshi

NSFetchRequest

2008-09-19 Thread chaitanya pandit
t now is i create an NSFetchRequest for each entity type (Person,Bank...) and execute each of them. So i end up executing 4 fetch requests, one for each entity. Is there any way to create a single NSFetchRequest which will search for the "ID" in all the