Removing an Object with A Certain Title from an NSTreeController.
Removing an Object with A Certain Title from an NSTreeController.
- Subject: Removing an Object with A Certain Title from an NSTreeController.
- From: Joshua Garnham <email@hidden>
- Date: Sat, 10 Oct 2009 04:25:57 -0700 (PDT)
Hi,
I am wondering how I could delete an object depending on it's title for the CoreData 'name' property I have.
To Add an Object I use this code:
NSManagedObjectContext *moc = [self managedObjectContext];
JGManagedObject *theParent =
[NSEntityDescription insertNewObjectForEntityForName:@"projects"
inManagedObjectContext:moc];
[theParent setValue:nil forKey:@"parent"];
// This is where you add the title from the string array
[theParent setValue:@"myTitle" forKey:@"name"];
[theParent setValue:[NSNumber numberWithInt:0] forKey:@"position"];
But I can't seem to find an equivalent function to remove An object.
You See, I have an array of strings so I was hoping I could loop through it deleting the objects with the title of any of the strings.
Cheers.
_______________________________________________
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