Creating a button on a View from a second View

Posted by BigJoke on Stack Overflow See other posts from Stack Overflow or by BigJoke
Published on 2009-10-20T11:52:23Z Indexed on 2010/05/01 16:17 UTC
Read the original article Hit count: 130

Filed under:
|
|

Hi,

I have this app I'm working on, which on a second view asks (textfield) the name for a button to be created on first view. After specifying the name and pressing OK button, the first view pops up (as demanded) but there's no new button, although created indeed. Can I use the following code in a second view method, to "refresh" the first view before presenting itself. What's wrong with this code? Any other approach? Thank you.

-(void)initWithView:(View1Controller *)aSuperview
{
    theSuperview = aSuperview;
}

- (IBAction)itemNameButton
{
    ...
    CGRect rectang;
    rectang = CGRectMake(0, 0, 320, 460);// just in case
    [theSuperview.view setNeedsDisplayInRect:rectang];
    ...
}

© Stack Overflow or respective owner

Related posts about uiview

Related posts about objective-c