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

View Single Post
Old 09-14-2009, 01:38 AM   #1 (permalink)
bluemonkey
Registered Member
 
Join Date: Jun 2009
Posts: 159
bluemonkey is on a distinguished road
Default Problem with UIPicker didSelectRow

Hi all,

In my application I have a two component UI Picker, I have coded the program so that when a user selects value in col 1 or col 2 in the Picker a label is updated with what is selected.

This works pretty fine until I tested it out on my iPhone last night I noticed that when I spin both picker component wheels at the same time back and forth and let go the picker selected values might show

col1 = green col2 = navy

However my label just shows Green - Black (to me it seems like some form of delay perhaps through the if statement which I coded.

Code:
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{	
	if (component == kSecondaryColourComponent)
	{
		part2 = [self.SecondaryColourTypes objectAtIndex:row];
	} else {
		part1 = [self.PrimaryColourTypes objectAtIndex:row];		
	}
	
	NSString *result = [NSString stringWithFormat:@"Your Selected Colours are: %@%@", part1, part2];
	
	
	NSLog(@"Your Selected Colours are: %@%@", part1, part2);
	labelColour.text = result;
}
Any tips would be appreciated.

Thanks Aaron
bluemonkey is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,183
Threads: 93,923
Posts: 402,162
Top Poster: BrianSlick (7,968)
Welcome to our newest member, gab20
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:02 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.