NimbleKit - fast iOS app development

Q re NKNavigationController and multiple pages

Ask questions and share your skills here

Q re NKNavigationController and multiple pages

Postby hwitten » Sat Apr 28, 2012 9:13 am

I got myself twisted up while trying to reload main.html from a settings page. Since IP, etc. changed I'm trying to start main.html from scratch or as close to scratch as possible.

For now I just want to confirm usage of NKNavigationController.

In my main.html:
Code: Select all
    var navController = new NKNavigationController();
    navController.setTitle("Stock Check");
    navController.addNavigationItem("Log In",'someFunction',"");
    navController.setTintColor(255, 0, 0);

Do I repeat this in every page or do I only change the values as needed.
I.e. on page2.html, is it:
Code: Select all
    var navController = new NKNavigationController();
    navController.setTitle("Page 2 Title");
    navController.setTintColor(255, 0, 0);

or
Code: Select all
    navController.setTitle("Page 2 Title");
    navController.setTintColor(255, 0, 0);

Or does a new var nav2Controller = new NKNavigationController(); get used on every page, I.e. a different var for the NKNavigationController() on every html page.

An associated question... I'm using a single js file and including it in each html. Should I be using a separate js file for each html file or is it ok to collect all (most) of my functions in a single functions.js include per project/app.
I have very little actual html. I'm trying to keep functions used once in the html page but would like to include all functions that may be used from different pages in a single dot.js.

Sorry for such a basic question but being new to Xcode and NK I'm trying not to shoot myself in the foot too many times :)
User avatar
hwitten
 
Posts: 57
Joined: Sat Apr 07, 2012 6:57 pm
Location: Langley, BC, Canada

Return to How To...

Who is online

Users browsing this forum: No registered users and 1 guest