How to have a new window after clicking a button

Discussion in 'Mac Programming' started by cs.iris, Feb 16, 2012.

  1. cs.iris, Feb 16, 2012
    Last edited: Feb 16, 2012

    cs.iris macrumors newbie

    Jan 11, 2012
    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:
  2. robvas macrumors 68030

    Mar 29, 2009
    What have you tried? It could be as simple as showing an Alert containing the desired text.
  3. cs.iris, Feb 16, 2012
    Last edited by a moderator: Feb 16, 2012

    cs.iris thread starter macrumors newbie

    Jan 11, 2012
    actually I've used it already.
    I tried this code:
    (it will simply get the input word and then add it to the string Hello.. I've used this as a test)
    NSString *str = [[NSString alloc] initWithFormat:@"Hello, %@", sol.text];
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Hello!"
    message:str delegate self
    [alert show];
    [str release];
    [alert release];
    [sol release];
    [super dealloc];
    @interface Word:UIViewController{
    IBOutlet UITextView *sol;
    @property(nonatomic, retain)UITextView *sol;
    --what do you think is my error???really need help... :(

Share This Page