• 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: NSTreeController content array bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTreeController content array bindings


  • Subject: Re: NSTreeController content array bindings
  • From: "Mazen M. Abdel-Rahman" <email@hidden>
  • Date: Mon, 23 Nov 2009 18:13:20 -0700

Thanks everyone for your help on this.

Turns out my problem was initializing and adding objects to my array to late in the process - I was doing it in the windowDidLoad function - by which time the bindings have already happened - and since I was add objects to the array by just using the addObject function the NSTreeController was not being informed of the changes.  When I moved the array initializing to the init function everything worked.

Thanks,
Mazen

On Nov 23, 2009, at 4:37 AM, Mike Abdullah wrote:

> http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CocoaBindings/Concepts/Troubleshooting.html#//apple_ref/doc/uid/TP40002148
>
> Don't bind to an NSMutableArray. Bind to an array property of an object.
>
> On 23 Nov 2009, at 03:20, Mazen M. Abdel-Rahman wrote:
>
>> Hi All,
>>
>> I am having trouble binding an NSTreeController's content array to an NSMutableArray through interface builder.
>>
>> In the bindings inspector of Interface Builder I bind to file's owner - which in my case is a subclass of NSWindowController, and set the model key path the the name of the NSMutableArray I want to bind to.  This does not seem to be working.
>>
>> However, if in my code I call the setContent method of NSTreeController passing in the array then it works.  So I know I can do it programmatically - but I was wondering why it's not working when I try it through interface builder.
>>
>> Thanks,
>> Mazen Abdel-Rahman
>> _______________________________________________
>>
>> 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
>

_______________________________________________

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: 
 >NSTreeController content array bindings (From: "Mazen M. Abdel-Rahman" <email@hidden>)
 >Re: NSTreeController content array bindings (From: Mike Abdullah <email@hidden>)

  • Prev by Date: Re: EXC_BAD_ACCESS when calling NSOpenPanel
  • Next by Date: mySQL libs and an apology...
  • Previous by thread: Re: NSTreeController content array bindings
  • Next by thread: Printing failed because PMSessionBeginCGDocumentNoDialog() returned -108.
  • Index(es):
    • Date
    • Thread