views:

37

answers:

1
-(void)showsearch:(id)sender
{
    SearchViewController *searchview =[[SearchViewController alloc] initWithNibName:@"SearchViewController" bundle:nil];

    settingpopoverController = [[[UIPopoverController alloc] 
                                    initWithContentViewController:searchview] autorelease];               
    [searchview release];
    [settingpopoverController presentPopoverFromBarButtonItem:sender 
                                    permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];


}

When I click on button, the app is crash and I got [UIPopoverController dealloc] reached while popover is still visible. message.

A: 

think autorelease is incorrect, here is a tutorial

http://www.jannisnikoy.nl/index.php/2010/04/ipad-tutorial-creating-a-popoverviewcontroller

Aaron Saunders
what you mean ?
saturngod
got it. i remove autorelease and it's working fine.
saturngod
@saturngod glad to be of help
Aaron Saunders