Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Aug 8, 2008, 09:28 PM   #1
Mac Me Up
macrumors regular
 
Join Date: Jun 2005
Location: Australia
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?
Mac Me Up is offline   0 Reply With Quote
Old Aug 8, 2008, 10:21 PM   #2
detz
macrumors 65816
 
Join Date: Jun 2007
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"];
detz is offline   0 Reply With Quote
Old Aug 9, 2008, 02:46 AM   #3
Mac Me Up
Thread Starter
macrumors regular
 
Join Date: Jun 2005
Location: Australia
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?
Mac Me Up is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

Privacy / DMCA contact / Affiliate and FTC Disclosure
Copyright 2002-2013, MacRumors.com, LLC