Problem with binding of @count
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