• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSArrayController - Remove all objects?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSArrayController - Remove all objects?


  • Subject: Re: NSArrayController - Remove all objects?
  • From: DKJ <email@hidden>
  • Date: Tue, 18 Nov 2008 19:51:02 -0800

The superclass NSObjectController has a "remove" method that might do what you want.

dkj


On 18-Nov-08, at 19:31 , Jean-Nicolas Jolivet wrote:

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@hidden http://www.silverscripting.com

_______________________________________________

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

Jean-Nicolas Jolivet email@hidden http://www.silverscripting.com

_______________________________________________

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

===================== Hatzic Intellectual Software Victoria BC, Canada




_______________________________________________

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


References: 
 >NSArrayController - Remove all objects? (From: Jean-Nicolas Jolivet <email@hidden>)
 >Re: NSArrayController - Remove all objects? (From: Jean-Nicolas Jolivet <email@hidden>)

  • Prev by Date: Re: NSArrayController - Remove all objects?
  • Next by Date: Binding a CoreData string value to an NSTextView
  • Previous by thread: Re: NSArrayController - Remove all objects?
  • Next by thread: Binding a CoreData string value to an NSTextView
  • Index(es):
    • Date
    • Thread