views:

296

answers:

1

Does anyone have an example of setting up a text field where users can enter their name and/or email address to submit it online to a high score database? I would like to have it be similar to the form that pops up when you attempt to download something from the AppStore, where you put in your email and password then can hit OK or Cancel. I can handle all the submission code and the server side processing at the website, but I just have had a hell of a time getting the text field and buttons setup properly.

Thanks in advance!

+1  A: 

This will show the dialog, but I am unsure how to make it responsive:

[dialog setDelegate:self];
[dialog setTitle:@"Enter Name"];
[dialog addButtonWithTitle:@"Cancel"];
[dialog addButtonWithTitle:@"OK"];
UITextField * nameField = [[UITextField alloc] initWithFrame:CGRectMake(20.0, 45.0, 245.0, 25.0)];
[nameField setBackgroundColor:[UIColor whiteColor]];
[dialog addSubview:nameField];
CGAffineTransform moveUp = CGAffineTransformMakeTranslation(0.0, 100.0);
[dialog setTransform: moveUp];
[dialog show];