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 03-03-2011, 05:11 AM   #1 (permalink)
Registered Member
 
TrueScot's Avatar
 
Join Date: Oct 2009
Posts: 48
TrueScot is on a distinguished road
Default UIPickerView selectRow

I have several view controllers with a couple of pickerviews and a tableview. I want to go back from one of the views to a view with a pickerview in it and go directly to the rows in a three component pickerview (offering the user the option to change one of the values). My problem is that I cannot get the UIPickerView selectRow to work. I have embedded [pickerview selectRow:r1 inComponent:c1 animated:YES] in the viewDidLoad method, I've tried the viewWillAppear method and a separate method but cannot get the components to move at all. Switching between the views is no problem and getting to the methods again is working but the components stay set a position 0. What am I doing wrong? All the pickerviews and tableview are working fine. I'm moving back from a tableview to a pickerview and this works fine incidentally, it just doesn't show the rows in the three components to start with which is what I'm trying to do.
TrueScot is offline   Reply With Quote
Old 03-03-2011, 05:18 AM   #2 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

Put breakpoints in your code (one before you call selectRow and the other where the pickerview loads the data). My guess is that your selectRow is gettings called before the picker view gets the chance to load the data.
baja_yu is offline   Reply With Quote
Old 03-03-2011, 07:56 AM   #3 (permalink)
Registered Member
 
TrueScot's Avatar
 
Join Date: Oct 2009
Posts: 48
TrueScot is on a distinguished road
Default

Quote:
Originally Posted by baja_yu View Post
Put breakpoints in your code (one before you call selectRow and the other where the pickerview loads the data). My guess is that your selectRow is gettings called before the picker view gets the chance to load the data.
Wouldn't the pickerView data be loaded before the viewDidAppear? Because I've tried selectRow in there also without success.
TrueScot is offline   Reply With Quote
Reply

Bookmarks

Tags
iphone sdk, objective-c iphone

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: 367
16 members and 351 guests
Absentia, akphyo, apatsufas, BinHex, dre, Error404, Gaz, gmarro, jeroenkeij, Kirkout, MarkC, mottdog, Music Man, PavelMik, whitey99, Wikiboo
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,666
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, cpsclicker
Powered by vBadvanced CMPS v3.1.0

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