开发者

ipad popover problem

开发者 https://www.devze.com 2023-02-07 09:47 出处:网络
I have one delegate file, one View Controller and one UIPopoverController My PopoverController is defined in delegate file.

I have one delegate file, one View Controller and one UIPopoverController

My PopoverController is defined in delegate file.

when I click on the view controller's button, the popover is shown.

The view controller also contains one m开发者_如何学Cethod named "refreshviewnow".

When I click on the PopoverController "submit button", I want to call that refreshviewnow function.

What should I have to write on submit button event ?


You need to make sure and set the delegate property of the PopoverController to the View Controller. Then in the "submit button" you can invoke the method on the delegate.

- (void) submit {
   [delegate refreshAction];
}

Good Luck.


I am not sure what you mean by "submit button" (maybe you should post some of the code you are using), but if you are trying to call a method that is in the same controller, you would do it like this:

- (void) methodToDisplayPopover
{
    [self refreshViewNow];
}

EDIT:

MySecondView *second = [[MySecondView alloc] init];
[second refreshViewNow];
[second release];


I got the answer now.

add observer in View Controller file for method refreshviewnow.

post the notification when popover is going to dismiss.

0

精彩评论

暂无评论...
验证码 换一张
取 消