|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
Basic N00b Question access UITextField defined in xib in Controller
Ok, so I'm a seasoned developer, just not a Cocoa one. I have a UITextField in a view defined in a xib. I've linked the view up with my controller and I can put buttons on there and call actions just fine. How do I access controls like text fields though so I can set and get text? I've tried all sorts of things with no luck...
I've googled it as well but I just can't figure out something that is no doubt really simple? |
|
|
|
0
|
|
|
#2 |
|
In you header file for you Delegate.
IBOutlet UILabel *labelName; Then, *Control* click on the Delegate class in IB and drag a connection from the labelName to the label. ....later [labelName setText:@"testing"]; |
|
|
|
0
|
|
|
#3 |
|
OK so in my interface I set up:
IBOutlet UITextField *txtName; Then I control click from my delegate and set txtName to be the outlet for the text field. That all works fine. However when I make a call to: [txtName setText:@"Testing"]; the text fields stays blank. The code is definitely being called, but on the screen nothing happens. I tried a call to setNeedsDisplay, but that didn't seem to do anything. I must be missing something really simple here? |
|
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| thread | Thread Starter | Forum | Replies | Last Post |
| Volume Control for External Displays | qwerf123 | MacBook Air | 4 | Nov 18, 2011 06:48 AM |
| Fan Control on 2011 iMac? | Ahheck01 | iMac | 17 | Jul 13, 2011 11:43 AM |
| UITextField Value Checking | dant19 | iPhone/iPad Programming | 5 | Jun 9, 2011 06:52 AM |
| How would I access a label on another view controller? | KiranPanesar | iPhone/iPad Programming | 11 | Apr 19, 2011 10:15 AM |
| App loading the wrong IB .xib on first compile | Scottapotmas | iPhone/iPad Programming | 0 | Dec 7, 2010 04:50 AM |
All times are GMT -5. The time now is 09:18 PM.






Linear Mode

