• 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: Array operators (was: Custom canRemove binding)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Array operators (was: Custom canRemove binding)


  • Subject: Re: Array operators (was: Custom canRemove binding)
  • From: Scott Anguish <email@hidden>
  • Date: Wed, 5 May 2004 21:21:42 -0400

On May 5, 2004, at 7:56 PM, Allan Odgaard wrote:

On 5. May 2004, at 21:56, Scott Anguish wrote:

[...] bind enabled2 to theArrayController.content.count

Which should probably be: theArrayController.arrangedObjects.@count

you're right about the arrangedObjects..

Speaking of which (array operators), are these supposed to be KVO compliant? cause it would seem that they are not, except when the key path involves an NSArrayController.

E.g. this works:
[arrayController addObserver:self
forKeyPath:@"arrangedObjects.@count" options:0 context:NULL];

Where this gives a run-time error:
id obj = [arrayController arrangedObjects];
[obj addObserver:self forKeyPath:@"@count" options:0 context:NULL];

Which imply that binding to [File's Owner].someArray.@count will also fail, unless File's Owner (also?) overload addObserver:... -- I hope I've overlooked something obvious, cause this does not make a lot of sense to me... ;)


@count isn't a legitimate keypath I don't think.

What of Foundation and AppKit are KVO compliant is something that should be documented.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Array operators (was: Custom canRemove binding)
      • From: Allan Odgaard <email@hidden>
    • Re: Array operators (was: Custom canRemove binding)
      • From: Allan Odgaard <email@hidden>
References: 
 >Custom canRemove binding (From: ian <email@hidden>)
 >Re: Custom canRemove binding (From: Allan Odgaard <email@hidden>)
 >Re: Custom canRemove binding (From: ian <email@hidden>)
 >Re: Custom canRemove binding (From: Scott Anguish <email@hidden>)
 >Array operators (was: Custom canRemove binding) (From: Allan Odgaard <email@hidden>)

  • Prev by Date: Re: Objective-C question
  • Next by Date: Re: Cocoa and glutMainLoop()?
  • Previous by thread: Array operators (was: Custom canRemove binding)
  • Next by thread: Re: Array operators (was: Custom canRemove binding)
  • Index(es):
    • Date
    • Thread