Binding to an NSDictionary "allValues" array

I don’t understand something about bindings? I bind (the contents of NSArrayController) to the NSDictionary "allValues" array, and it considers it empty. I am attached to a random object with a property that I set in the same NSDictionary "allValues" array, and it works fine.

Is this the expected behavior, or am I doing something wrong? Also, if this is expected, what is the standard way to handle this? Creating relatively aimless objects just to store arrays in properties so that I can bind to them seems ugly.

+3
source share
1 answer

Linking with @"allValues"means the dictionary has been sent a -valueForKey:@"allValues". The dictionary then interprets this by looking through -objectForKey:@"allValues"which is not what you need in this case.

Try binding to @"@allValues"instead (see the docs for more details -[NSDictionary valueForKey:])

+4
source

Source: https://habr.com/ru/post/1733296/


All Articles