Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

cs.iris

macrumors newbie
Original poster
Jan 11, 2012
4
0
Hello..
Do anyone of you knows how to make a new window appear after clicking a button?
I know this is a basic question but I can't seem to make it. I've done already the ones that can output what you type in the textfield, but the problem in my app is that I am using Label.

flow of the program:
After clicking the done button, I should view a new window to show the words(that is inside/generated by the solve button).And then, I can close the new window and get back to the app/original window.

After reading so many posts, I still don't know how to do this. Can someone please help me?:(
Thanks in advance :)

kinda urgent..pleassseee
--I am a newbie:eek:
 
Last edited:

robvas

macrumors 68040
Mar 29, 2009
3,240
629
USA
What have you tried? It could be as simple as showing an Alert containing the desired text.
 

cs.iris

macrumors newbie
Original poster
Jan 11, 2012
4
0
What have you tried? It could be as simple as showing an Alert containing the desired text.

actually I've used it already.
I tried this code:
Code:
(it will simply get the input word and then add it to the string Hello.. I've used this as a test)
-(IBAction)done:(id)sender{
NSString *str = [[NSString alloc] initWithFormat:@"Hello, %@", sol.text];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Hello!"
message:str delegate self
cancelButtonTitle:@"Done"
otherButtonTitles:nil];
[alert show];
[str release];
[alert release];
}
-(void)dealloc{
[sol release];
[super dealloc];
}

//.h
@interface Word:UIViewController{
IBOutlet UITextView *sol;
}
@property(nonatomic, retain)UITextView *sol;

-(IBAction)done:(id)sender;

--what do you think is my error???really need help... :(
 
Last edited by a moderator:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.