This is my first post to StackOverflow and I am also new to Xcode and Objective-C.
I have read about delegates and I have also experimented with other peoples code. However, I wanted to see if I could create something myself that uses delegates without the aid of copying someone else’s code.
What I am trying to do, to understand delegates, is to get a UITextField delegate to update a label every time a user types a key on the keyboard.
I created a xib file and connected a TextField to a UITextField *myTextField and a Label UILabel *myLabel in my .h file.
I also added to the .h file of my ViewController Class.
However, I’m not sure what delegate method to use because the optional ones I can use as listed in the UITextFieldDelegate.h only seem to be able to update after Editing is finished. Also I’m not sure if I should put the AppDelegate method in the .h file associated with my xib or the AppDelegate.h file.
I would appreciate any help with some direction on this.
So if you have a UITextField myTextField linked to your nib IB TextField object, and a UILabel myLabel linked to your nib IB Label object and you’ve made your Textfield point to your files owner then try this to see if it helps.
I just typed this up quickly, and I didn’t test it, so check it for errors first.