Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 11-04-2011, 01:20 AM   #1 (permalink)
Registered Member
 
Join Date: Nov 2011
Posts: 2
jellowtk is on a distinguished road
Default Problem with UITextField - iOS5

editController.nameTextField.text = album.name; - This statement sets editController.nameTextField.text to null. With NSLog() verified that album.name contains proper value. Tried self.nameTextField.text = @"Test"; from - (void)viewDidLoad of controller and it is working properly. Outlets are set to UITextField properly, I believe. Statement that fails is called from a parent controller of host controller of UITextField. I had done the same in past and had succeeded. Any clues will be of great help. (iOS 5, XCode 4.2, Snow Leopard; previously, I tried this and succeeded in Lion).
jellowtk is offline   Reply With Quote
Old 11-04-2011, 04:39 AM   #2 (permalink)
Registered Member
 
Join Date: Nov 2011
Posts: 2
jellowtk is on a distinguished road
Default Issue solved

I have solved the issue. I wanted to initialize the destination viewController to be displayed from the source viewController (parent view controller) from prepareForSegue:. I had succeeded with this method (failed mathod) earlier, in Mac OS X Lion, XCode 4.2, iOS5 SDK. I debugged and confirmed that prepareForSegue: is called before viewDidLoad:. To solve, I added property (NSString) in destination viewController class, initialized property from prepareForSegue: and initialized UITextField control from viewDidLoad: using property value.
I am quoting excerpts from an article that mislead me:-
"The prepareForSegue method is invoked whenever a segue is about to take place. The new view controller has been loaded from the storyboard at this point but it’s not visible yet, and we can use this opportunity to send data to it. (You never call prepareForSegue yourself, it’s a message from UIKit to let you know that a segue has just been triggered.)"
Also, I wonder why this was working in OS X Lion (As I see this was the only difference earlier when the method I followed first, worked)?
jellowtk is offline   Reply With Quote
Reply

Bookmarks

Tags
text cannot be set, uitextfield

Thread Tools
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
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 415
17 members and 398 guests
7twenty7, Alex-alex, Apptronics RBC, baja_yu, dre, FrankWeller, gwelmarten, ipodphone, jeroenkeij, jleannex55, matador1978, n00b, pbart, reficul, Retouchable, Sami Gh, usernametaken
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,125
Posts: 402,910
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:18 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0