Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Removing an Object with A Certain Title from an NSTreeController.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Removing an Object with A Certain Title from an NSTreeController.



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



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.