I am facing one issue regarding the UIPopoverController. When I execute follo开发者_开发问答wing
- (void)showPopover:(id)sender
{
iPopOver = [[UIPopoverController alloc] initWithContentViewController:nav];
iPopOver.delegate = self;
[iPopOver presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
}
Application crashes and found this error
-[IPadController respondsToSelector:]: message sent to deallocated instance 0xc93b510
Not able to debug this behavior.
I think the sender argument is not a UIBarButtonItem or is an outdated reference.
You should replace your code with:
[iPopOver presentPopoverFromBarButtonItem:myButton
permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
where myButton is a reference to your UIBarButtonItem.
Good luck!
精彩评论