Steven,

The Outline View isn't being displayed with an NSArrayController rather an 
NSTreeController, but I think you can still override -remove:.
Also, how would I check to see whether the row the user wants to delete has any 
children?

Cheer,
Josh.


________________________________
From: Steven Degutis <[email protected]>
To: Joshua Garnham <[email protected]>
Cc: [email protected]
Sent: Monday, 7 September, 2009 17:20:50
Subject: Re: Making an NSAlert be displayed when the User attempts to delete a  
row from an NSOutlineView when it has children.

Josh,

The outline view is probably being displayed with an NSArrayController, not 
just "Core Data", which is an abstract term for a ton of APIs. As well, 
NSArrayController falls into part of Cocoa, as well as Core Data, but that's 
another story.

Assuming your row is "removed" via an outlet to your NSArrayController's 
-remove: method, and assuming you're using NSArrayController for this in the 
first place, simply subclass your NSArrayController and provide the NSAlert 
behavior by overriding -remove: and then call super's -remove: once the NSAlert 
has come back positive (for chlamydia).

-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.org/



On Mon, Sep 7, 2009 at 10:14 AM, Joshua Garnham <[email protected]> 
wrote:

>How would I do this?
>>The Outline View is being used with Core Data.
>
>>Cheers,
>>Josh.
>
>
>
>
>>_______________________________________________
>
>>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/steven.degutis%40gmail.com
>
>>This email sent to [email protected]
>



_______________________________________________

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]

Reply via email to