Release iPad UipopoverController from its content controller

So I have a popover with a button. When the button is pressed, I want the popup to disappear. It seems easy, but I can’t figure out my life. I use The code to display popover is as follows:

AddCategoryViewController* content = [[AddCategoryViewController alloc] init];
UIPopoverController* aPopover = [[UIPopoverController alloc]< br /> initWithContentViewController:content];
aPopover.delegate = self;
[content release];

// Store the popover in a custom property for later use.
self.addCategoryPopover = aPopover;
[aPopover release];
[addCategoryPopover presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];

In addcategoryviewcontroller, I have:

-(IBAction)saveAddCategory:(id)sender {
if (rootViewController == nil)
rootViewController = [[RootViewController alloc] init];

[rootViewController.addCategoryPopover dismissPopoverAnimated:YES];
[rootViewController dismissPopover];
}

Rootvie wcontroller is where the popover is created. Unfortunately, none of these methods solve it. Any help?

You will see a warning on this line.

aPopover.delegate = self;

If you want to execute your code. The application will crash. Instead, you need to be like this.

So I have a popover with a button. When the button is pressed, I want the popup to disappear. It seems easy, but I can’t figure out my life. I use to display the popover The code is as follows:

AddCategoryViewController* content = [[AddCategoryViewController alloc] init];
UIPopoverController* aPopover = [[UIPopoverController alloc]
initWithContentViewController:content];
aPopover.delegate = self;
[content release];

// Store the popover in a custom property for later use.
self .addCategoryPopover = aPopover;
[aPopover release];
[addCategoryPopover presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];

In addcategoryviewcontroller, I have:

< p>

-(IBAction)saveAddCategory:(id)sender {
if (rootViewController == nil)
rootViewController = [[RootViewController a lloc] init];

[rootViewController.addCategoryPopover dismissPopoverAnimated:YES];
[rootViewController dismissPopover];
}

Rootviewcontroller is where popovers are created. Unfortunately, none of these methods solve it. Any help?

You will see a warning on this line.

aPopover.delegate = self;

If you want to execute your code. The application will crash. Instead, you need to be like this.

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 1000 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.