uiview - Key Value Bindings iPhone -


I have a bunch of NSDictionaries that are stored in an NSArray. During the pressed (UIView) coordinates store stores for buttons, their names, and their respective objects for loading.

When the button is pressed, I can get this button that this string is in the format, for example "settings" and then I would like to run the object - (zero) settings {} .

Now I know how I will do it with other statements, but I would like to save them because they are dirty and thought that value would be the way of binding but I do not believe they are present on the iPhone.

Are they available on the iPhone? What I have read is not even in iOS 4 if they are, how do I apply it? If not otherwise there is no better way to do this? Can I store the context of UIView in order to push it into NSArray instead of a string, and if this happens it will affect performance?

Cheers.

Key value binding exists in iOS, but you have to do it manually. You can create a square from the "button" and you can specify that you can create a property of NSDictionary that you can assign and you can see the change in the charge, and you can read the value in the representative and Can allocate themselves.

Okay here's my button. File

  @interface MyCustomButton: NSButton NSDictionary * store; @end - (NSDictionary *) store; - (Zero) Setstore: (NSDictionary *) V;  

And here my button is .m file

  @implementation MyCustomButton - (zero) Delok {[Self setstore: zero]; [Super DeLoc]; } - (zero) Load value: {// Fill your loading values ​​here // It is not correct, you may need // to see help to get the correct name of the function [auto-settext: [ Store stringForKey: @ "buttonLabel"]]; } - (Zero) Setstore: (NSDictionary *) V {if (store! = Nil) {[store removeObserver: self forKeyPath: @ "buttonLabel"]; [Store Observer: Kekepepath: @ "ButtonX"]; [Store Observer: For Kekepath: @ "Button"]; [Store Release];} If (V == zero) Return; Store = [Maintain V []] [Store addObserver: For Kekpath: @ " Button label "option: 0 references: zero]; [Store addObserver: self-paced: @" button "option: 0 reference: zero]; [store addObServer: self-paced: @" button Y "option: 0 reference: zero]; [ Self load value];} - (NSDictionary *) Store {Returns [Store Autorigse];} - (Zero) Inspection Validate Path: (NSSTING *) Well Jeepage of objet: (id) object change: (NSDragment *) change reference: (Zero *) Reference {// Here you can identify which pane / self load value];} @ and  

And perhaps you have given example of Mitton in the beginning of the code or ...

  MyButton * button = [[[MyButton Allok] Init] AutoCare]; // View Add button for ... [button setstore: myDictionary]; // button since this point automatically // // whenever modify modify Or  

Comments