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 07-15-2010, 10:39 AM   #1 (permalink)
Registered Member
 
TrueScot's Avatar
 
Join Date: Oct 2009
Posts: 48
TrueScot is on a distinguished road
Red face UIPickerview - Change Row color in an IBAction

I'm using a UIPickerview to 'collect ' several parameters using two components. Once the parameter type (component0) and a value (component1) are reached the user can select them by hitting an accept Button and moving on to the next parameter. I want to change the color of a UIPickerview row when the values have been selected and I want to do this via an IBAction connected to the Button. I can get the row to change color through an UIColor colorWithRed green blue etc but I don't quite know how to wrap it up in the IBAction. Can someone please advise me?
TrueScot is offline   Reply With Quote
Old 07-15-2010, 11:13 AM   #2 (permalink)
Registered Member
 
Join Date: Jul 2010
Location: Boston, MA
Posts: 5
Matt Dunn is on a distinguished road
Default

What about using the view controller as a delegate and implementing the UIPickerViewDelegate protocol?

Wouldn't implementing pickerView:didSelectRow:inComponent: allow you to determine what has been selected by the user? For disclosure, I've not tried this, but implementation of the callback seems like a good thing to try.

-Matt
Matt Dunn is offline   Reply With Quote
Old 07-15-2010, 12:10 PM   #3 (permalink)
Registered Member
 
TrueScot's Avatar
 
Join Date: Oct 2009
Posts: 48
TrueScot is on a distinguished road
Default

Hi Matt. I've no problem in determining which row in which component has been selected. The user can roll the components indefinitely but there has to be an event when the user chooses to 'keep' the values when the component(s) have stopped. The user has to 'collect' several, different parameters from a broad selection and this is where the button (IBAction) comes in.

Basically, I need to change the row color (in component 0) to indicate to the user that this parameter has already been selected and the user will do this by hitting the button (which in turn will set the color of the row selected). So, the problem is how do I do this in an IBAction (ie. call a method from inside the IBAction?) when I already know the row and component.
TrueScot is offline   Reply With Quote
Old 07-15-2010, 02:50 PM   #4 (permalink)
Registered Member
 
Join Date: Jul 2010
Location: Boston, MA
Posts: 5
Matt Dunn is on a distinguished road
Default

Largely a beginner, so take this with a grain of salt, but it doesn't sound like you want another IBAction. It sounds more like you want the class that implements the IBAction to also include IBOutlets mapped to the picker, which should give you programmatic access to the picker and its properties from within the IBAction call.

Sincere apologies if I am off base on this.

-Matt
Matt Dunn is offline   Reply With Quote
Old 07-16-2010, 03:17 AM   #5 (permalink)
Registered Member
 
TrueScot's Avatar
 
Join Date: Oct 2009
Posts: 48
TrueScot is on a distinguished road
Default

"Another IBAction"? "IBOutlets mapped to the picker"? Sorry Matt but I think you may have misunderstood what I'm looking for. I want to fire off a method when I hit the Button (IBAction) - "I don't quite know how to wrap it up in the IBAction". I'm just looking for advice on how best to do this.

Last edited by TrueScot; 07-16-2010 at 03:24 AM.
TrueScot is offline   Reply With Quote
Reply

Bookmarks

Tags
iphone development, iphone sdk, uipickerview, xcode assistance

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: 332
14 members and 318 guests
akphyo, alexP, appservice, cgokey, EXOPTENDAELAX, flamingliquid, guusleijsten, mariano_donati, ohmniac, Paul Slocum, PavelSea, SLIC, v1n2e7t
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,653
Threads: 94,115
Posts: 402,888
Top Poster: BrianSlick (7,990)
Welcome to our newest member, ohmniac
Powered by vBadvanced CMPS v3.1.0

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