Re: Leaks with Core-Data while fetching data
Re: Leaks with Core-Data while fetching data
- Subject: Re: Leaks with Core-Data while fetching data
- From: "Hell's KItchen Hell's KItchen" <email@hidden>
- Date: Mon, 7 May 2007 19:08:50 +0200
I've used MallocDebug in order to see leaks and memory usage. I've
found that in my function:
- (ANTArtNode *)getArticleNodeForID:(NSString *) _id {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
ANTArtNode *node = nil;
NSExpression *right = [NSExpression expressionForConstantValue: _id];
NSPredicate *pr = [NSComparisonPredicate
predicateWithLeftExpression: keypathmsgid rightExpression: right
modifier: NSDirectPredicateModifier type:
NSEqualToPredicateOperatorType options:
NSCaseInsensitivePredicateOption];
[request setPredicate: pr];
NSError *error;
NSArray *array = [[self managedObjectContext]
executeFetchRequest:request error:&error];
if (array != nil) {
node= [array lastObject];
} else {
NSLog(@"Error occurred in query: %@", [error description]);
return nil;
}
[pool release];
return node;
}
there are lots of NSPredicate objects marked as leaks:
NSPredicate *pr = [NSComparisonPredicate
predicateWithLeftExpression: keypathmsgid rightExpression: right
modifier: NSDirectPredicateModifier type:
NSEqualToPredicateOperatorType options:
NSCaseInsensitivePredicateOption];
Is possible to generate a single NSPredicate and change the right
expression each time I need? I've created a single istance of left
expression and NSRequest but I still not found a method to do it.
it could be a solution.
2007/5/7, Chris Hanson <email@hidden>:
On May 6, 2007, at 9:20 AM, Hell's KItchen Hell's KItchen wrote:
> b) the write process to persistent store-sql- could take a while (I
> haven't tried with 3000+ indexes but I've read that the coredata
> engine it's not so fast).
Why do you say this - what leads you to believe that Core Data isn't
fast? Core Data is quite fast when used correctly.
-- Chris
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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