Augustus1
Augustus1

Reputation: 715

Change Cocoa binding value in code

I have an NSTextField and it has a binding for its "value" property to "Shared User Defaults Controller", Controller Key "values", Model Key Path "myName".

Is there a way to change the value in code?

Upvotes: 0

Views: 64

Answers (1)

Ken Thomases
Ken Thomases

Reputation: 90531

Just set the appropriate value in the user defaults:

[[NSUserDefaults standardUserDefaults] setObject:@"Some new name" forKey:@"myName"];

Upvotes: 1

Related Questions