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 08-01-2011, 02:03 PM   #21 (permalink)
mavrik5150
Registered Member
 
Join Date: Sep 2010
Posts: 194
mavrik5150 is on a distinguished road
Default

Below is an example on how to create a UIAlterView with a single Text Box, if you want two text boxes then you will need to adjust and add what you need to make both fit. Also, I found it easier to make the TextBox an ivar, this way I can use the self delegate to grab the text that was entered after the Update button was pressed, this should get you on the right path:

Code:
UIAlertView *optionAlert = [[UIAlertView alloc] initWithTitle:@"Update Monthly Goal" message:@"this message gets covered" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Update", nil];
    optionText = [[UITextField alloc] initWithFrame:CGRectMake(12, 45, 260, 25)];
    [optionText setBackgroundColor:[UIColor whiteColor]];
    NSString *placeholder = [NSString stringWithFormat:@"$%@",MTDGoal];
    optionText.placeholder = placeholder;
    optionText.keyboardType = UIKeyboardTypeNumberPad;
    optionText.keyboardAppearance = UIKeyboardAppearanceAlert;
    optionText.tag = 10;
    optionText.delegate = self;
    optionAlert.tag = 25;
    [optionAlert addSubview:optionText];
    [optionAlert show];
    [optionAlert release];
I'm also using the alert tag to determine which UIAlertView is present since this screen that I pulled this from has 2 other Alerts that show up depending on the WebService that is sending data (such as a Timeout Message from the DB).
mavrik5150 is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,605
Threads: 94,084
Posts: 402,783
Top Poster: BrianSlick (7,990)
Welcome to our newest member, champa812
Powered by vBadvanced CMPS v3.1.0

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