0

I am new to Xcode and Objective-C. I could see a demo that make such a reference from a text field on the View to a string member of the class such that whenever the string is changed the contents of the Text Field is changed too. However this demo is not with the latest Xcode and I cannot find how to do the same with Xcode 4.3.2.

Thanks

Chirag Kothiya
  • 955
  • 5
  • 12
  • 28
Simon
  • 509
  • 7
  • 25
  • Hi Simon, do you mean the assistant editor? i.e. in Interface Builder or Storyboard editor. With the view you are building selected, press the Assistant Editor button, middle button on top right of screen that looks like a bow-tie. This will display the code editor where you can option-drag from a button or other element to create a IBOutlet. – bennythemink May 06 '12 at 09:29

1 Answers1

0

This has nothing to do with XCode, this is objective-c. XCode is just an code editor.

What you are looking for is an observer. Add an observer to you NSString and whenever it gets changed you can update your UITextField. I think I have some code somewhere that does that, I'll see if I can find it.

edit
Here is a link to the a question I made once upon a time: Adding an observer to an NSString

Community
  • 1
  • 1
Paul Peelen
  • 10,073
  • 15
  • 85
  • 168
  • My understaning was that xcode allows you to do it with its UI. – Simon May 06 '12 at 08:41
  • again, XCode is an editor. Not a programming language, not a library for Objective-C.. it is *just* an editor. Like Eclipse is a editor for PHP and Java, and Netbeans for Java. I can't find the example code right now, but i'll have a look for it again later today. – Paul Peelen May 06 '12 at 08:44
  • I understand but xcode is also a GUI editor that for example allows one to right-click on a button and drag from "Touch Up Inside" to some message and make this relationships. Such an action generates code too. – Simon May 06 '12 at 08:54
  • I went to the tutorials and found out the information as mentioned above by bennythemink – Simon May 13 '12 at 08:40