I was able to get it done using:

[self removeObjectsAtArrangedObjectIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [[self arrangedObjects] count])]];

can't believe there isn't a better way to do it??


On 18-Nov-08, at 10:23 PM, Jean-Nicolas Jolivet wrote:

I'm working on a custom NSArrayController (basically just a subclass that allows drag and drop for a table view)...

So far it's working well however, when new files are dropped on my table view, I need to remove all the current files... right now the dropped files are only added to the list (i.e. added to my Array Controller)...

Looking at NSArrayController's doc, I see methods for adding/ selecting/removing objects, but no method that removes all objects... I can't even find how to get the amount of objects in my array...

Is there any way to remove all files from an array controlled by an arraycontroller? Or at least a way to access the array from within my custom ArrayController's code?? I tried [self setArrangedObjects:] but the method doesn't exist....


Jean-Nicolas Jolivet
[EMAIL PROTECTED]
http://www.silverscripting.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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/silvertab%40videotron.ca

This email sent to [EMAIL PROTECTED]

Jean-Nicolas Jolivet
[EMAIL PROTECTED]
http://www.silverscripting.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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