• 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
Problem with binding of @count
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with binding of @count


  • Subject: Problem with binding of @count
  • From: Mikael Wämundson <email@hidden>
  • Date: Fri, 28 Nov 2008 23:41:36 +0100

I have some problem binding the number of objects in an array to a text label in app.

Just binding the label to my array controller (Controller Key = arrangedObjects and Model Key Path = @count) works fine and the value is updated when a change is made to the array.

But I want the number of objects to be part of a text string ("The number of students is: <the value>"). Thus I put this code into myDocument.m:

-(NSString *) numberOfStudents
{
return [NSString stringWithFormat:@"The number of students is: %@", [theStudentArrayController valueForKeyPath:@"arrangedObjects.@count"]];
}


No error during compilation or run-time, but value in the text label is not updated when the array is changed.

Any clues?

/wamund




_______________________________________________

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


  • Follow-Ups:
    • Re: Problem with binding of @count
      • From: j o a r <email@hidden>
    • Re: Problem with binding of @count
      • From: j o a r <email@hidden>
  • Prev by Date: NSButton with PDF Image
  • Next by Date: Re: Problem with binding of @count
  • Previous by thread: NSButton with PDF Image
  • Next by thread: Re: Problem with binding of @count
  • Index(es):
    • Date
    • Thread