Generic “help” view which is accessible from all views in uinavigationView

Assuming an application has many views pushed to a uinavigationViewController, each view is different in content.

since the elements in the app are complex, I would like to show a small help view for specific views or elements in a specific view. Imagine a "?" button that when pressed on will pop a new view in the center of the screen, playing youtube help video, or just a textual HTML loaded from a remote server.

Question: what is the best strategy for doing such a thing? where should I place this code (App Delegate?)

if so, how would I call it from other views (with URL Parameter)

-(void)showHelpView:(NSString *)theURLString{

    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 800, 600)];

    //webView.delegate= self;
    [webView  loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:theURLString]]];
    [window addSubview:webView];
    [window makeKeyAndVisible];
- (void)webViewDidStartLoad:(UIWebView *)webView

- (void)webViewDidFinishLoad:(UIWebView *)webView

- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error


I'd prefer using pseudo-modal views. So that you create view every time, and add it on top of current window. I've used this approach for OAuth 2.0 authorisation popup in my last app.

Basically you create custom UIViewController subclass, provide custom initialisator, such as, for example:

// - (id) initWithURL: (URL*)url {
// ...
// self.url = url;
// ...
// return self;

PseudoModalViewController* pmvc = [[PseudoModalViewController alloc] initWithURL:@""];

After you've created view you add it on top of current window:

UIWindow* window = [[UIApplication sharedApplication] keyWindow];
    window = [[[UIApplication sharedApplication] windows] objectAtIndex:0];
[window addSubview:pmvc.view];

In, for example, viewDidLoad you load url obtained in initialisator:

- (void)viewDidLoad
    [super viewDidLoad];

    [self.webView loadRequest:[NSURLRequest requestWithURL:url]];

You may even design UI in Interface Builer for that. As a last piece I'd recommend add to include full screen transparent background view to ensure that all views below are disabled.

Oh, almost forgot, you hide that view with just a simple [self.view removeFromSuperview]. Don't forget to provide correct memory management for that view (i.e. release it in time, etc).

Need Your Help

How to detect client locale in JSF application?

java jsf localization internationalization

How can I use ServletRequest.getLocale() in JSF application, when Servlet is absent in my code and is provided by JSF implementation? I'm trying to use ServletContextListener, but is it possible to...

How to pass the correct data format from SQL to PHP

php javascript ajax json highcharts

I need to create a basic column chart using highcharts. Here's my PHP code:

Literature suggestions for best practices / good coding techniques

c# java

I am a mid level developer. Currently I work in C# ASP.NET but I have worked in PHP, classic ASP, and a tiny bit in Java (would like to get more into this in the future). I am looking for a few

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.