views:

24

answers:

2

Hey.

I have a reload-button in my UINavigationController that is supposed to send a reload-selector to the current loaded view, or the view on top, I don't know what to call it :p

I have no idea where to start, so if someone could give me a pointer (no, not that kind :p), that would be great :)

Thanks!

+2  A: 

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)];
}
Vladimir
+1 (and accepted) for security.
Emil
+1  A: 
[navigationController.topViewController.view reload];
Ole Begemann
+1 for simplicity.
Emil