On 2011-10-21, at 11:57 AM, David Riggle wrote:
> I'm currently experimenting with the following to see if it's as safe and
> perhaps faster:
>
> - (void)prepareForDeletion
> {
> // track object deletion for faster testing below
> NSString *objIDStr = [[[self objectID] URIRepresentation]
> resourceSpecifier];
> [_deletedObjectIDs addObject:objIDStr];
> }
>
> - (BOOL)retainedObjectHasBeenDeleted
> {
> NSString *objIDStr = [[[self objectID] URIRepresentation]
> resourceSpecifier];
> return [_deletedObjectIDs containsObject:objIDStr];
> }
>
> Unfortunately _deletedObjectIDs grows without bound. So you wouldn't want to
> use this approach if you are expecting a lot of deletions.
This also wouldn't work if you can undo
deletions._______________________________________________
Cocoa-dev mailing list ([email protected])
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 [email protected]