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-08-2010, 06:52 AM   #1 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 129
stephen is on a distinguished road
Default UIPicker

Hello,

I've setup a UIPicker as a view controller and its not quite the way I want it.

How can I set it up as in the image in the link below:

How to use Picker in iphone? | iPhone Tutorials for Developers

I want to have a textbox with a drop down arrow and have the picker load a sub view of my current View Controller.

Any help much appreciated.

Regards,
Stephen
stephen is offline   Reply With Quote
Old 07-08-2010, 08:26 AM   #2 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 129
stephen is on a distinguished road
Default

*Bump*
stephen is offline   Reply With Quote
Old 07-08-2010, 08:44 AM   #3 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 100
mobin_shaikh is on a distinguished road
Default

Hi stephen once again,
wt is ur actual problem i dnt understand
mobin_shaikh is offline   Reply With Quote
Old 07-08-2010, 08:58 AM   #4 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 129
stephen is on a distinguished road
Default

Okay, I want the user to be able to tap on textbox/dropdown menu (as in the link) and select some predefined values from the picker. I'm not sure how to go about call the PickerViewController when the users taps on the textbox ?

I have the following code in place:

PickerViewController.h
Code:
@interface PickerViewController : UIViewController {

	IBOutlet UIPickerView *pickerView;
	NSMutableArray *list;
}

@end
PickerViewController.m
Code:
#import "PickerViewController.h"

@implementation PickerViewController


-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)thePickerView{
	return 1;
}


-(NSInteger)pickerView:(UIPickerView *)thePickerView numberOfRowsInComponent:(NSInteger) forComponent:(NSInteger) component{
	return[list count];
}


-(NSString *)pickerView:(UIPickerView *)thePickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component{
	return[list objectAtIndex:row];
}


-(void)pickerView:(UIPickerView *)thePickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{
	NSLog(@"Selected item: %@ index of selected item: %i",[list objectAtIndex:row], row);
}

// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];
	
	list = [[NSMutableArray alloc] init];
	[list addObject:@"red"];
	[list addObject:@"blue"];
	[list addObject:@"yellow"];
	[list addObject:@"pink"];
}

- (void)dealloc {
	[list release];
    [super dealloc];
}


@end
stephen is offline   Reply With Quote
Old 07-08-2010, 10:03 AM   #5 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 129
stephen is on a distinguished road
Default

okay, forget about the drop down menu, a bit more research tells me that it can't be done.

So, I want the user to tap on a textbox(doesn't have to be a text box) and have the UIPicker appear, their selection should then appear in the box.

Regards,
Stephen
stephen is offline   Reply With Quote
Reply

Bookmarks

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: 345
13 members and 332 guests
akacaj, cgokey, esoteric, EXOPTENDAELAX, GHuebner, givensur, HemiMG, Mirotion22, mjnafjke, Pudding, SLIC, Sloshmonster, Sonuye857
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,652
Threads: 94,115
Posts: 402,887
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Sonuye857
Powered by vBadvanced CMPS v3.1.0

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