开发者

ipad popover problem

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜