开发者

Send selector (reload) to current view

I have a reload-button in my UINavigationController that is supposed to send a reload-selector to the current loaded view, a.k.a the view on top. I can't figure out how I can achieve this.

I have no idea where to start, so 开发者_JAVA百科if someone could give me a pointer, that would be great :)

Thanks!


You can get controller that's on top of navigation stack via topViewController property in UINavigatiionController, so you'll get code something like (or you can get view from controller and send a message to it directly if you want):

UIViewController* topController = navigationController.topViewController;
if ([topController respondsToSelector:@selector(reload)]){
   [topController performSelector:@selector(reload)];
}


[navigationController.topViewController.view reload];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜