• 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
NSArrayController insertObject:atArrangedObjectIndex: not working as expected
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSArrayController insertObject:atArrangedObjectIndex: not working as expected


  • Subject: NSArrayController insertObject:atArrangedObjectIndex: not working as expected
  • From: "douglas a. welton" <email@hidden>
  • Date: Sat, 7 Jan 2006 21:08:16 -0500

Hi All,

I have run into an issue where the results that I am getting when I use -insertObject:atArrangedObjectIndex: in my NSArrayController do not match up with what I expect.

My application uses a subclass of NSArrayController to manage an NSArray that represents the clips in a video library. I use - setPredicateFilter: when displaying the clips for an individual Playlist in my clips table. This works as expected.

My problem arises when i accept new clips into my Playlist using my drag'n'drop routines. When a user drags a movie from the Finder onto my clip table, I create a New_Clip object and use - insertObject:atArrangedObjectIndex: to insert the New_Clip at the Target_Row.

What I notice is that -insertObject:atArrangedObjectIndex: inserts the New_Clip in the correct position of the NSArray returned by [self arrangedObjects]... However, the New_Clip is appended at the end of the NSArray returned by [self content].

What I want is for the New_Clip to be placed in the correct place in both the arrangedObjects array and the content array. Is this a case where I need to subclass -insertObject:atArrangedObjectIndex:?

thanks,

douglas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSArrayController insertObject:atArrangedObjectIndex: not working as expected
      • From: Scott Anguish <email@hidden>
References: 
 >Saving the text selection with master/detail view and bindings (From: Adam Knight <email@hidden>)

  • Prev by Date: Re: NSAttributedString: lossy attachments when serializing/archiving?
  • Next by Date: Re: WebView and NSTabView
  • Previous by thread: Re: Saving the text selection with master/detail view and bindings
  • Next by thread: Re: NSArrayController insertObject:atArrangedObjectIndex: not working as expected
  • Index(es):
    • Date
    • Thread