NimbleKit - fast iOS app development

goBack not working?

Please post here if you think only NimbleKit developers can solve your problem

goBack not working?

Postby paul3252 » Sun Apr 08, 2012 7:50 pm

I have searched the forum and their is not too much regarding the navigation controller goBack function. I thought the below code would take me back to the page 'calling' the page on which this internet check occurs. It does not however do that. The page stops, remains blank but does not return to the calling page.

Any suggestions?

Code: Select all
<script type="text/javascript">
           
            var navController = new NKNavigationController();
            navController.setTitle("News Feed");
            navController.setTintColor(0,62,128);
                       
            function onPageShown(caller)
            {
           
            if (NKIsInternetAvailableViaWifi() != "1" && NKIsInternetAvailableViaCellularNetwork() != "1")
            {
               
                NKAlert("Error", "Internet Connection is required");
                navController.goBack();
               
            }
            }
             </script>
paul3252
 
Posts: 25
Joined: Fri Mar 16, 2012 10:35 pm

Re: goBack not working?

Postby ryubr » Mon Apr 09, 2012 5:20 pm

This code alone seems ok, but we don´t know if you have more code on that page that could crate a javascript error for instance. Use try /catch and NKLog to check what is happening under the hood :-)
ryubr
NimbleKit Expert
 
Posts: 445
Joined: Fri Jun 19, 2009 5:36 am

Re: goBack not working?

Postby rouillip » Tue Apr 10, 2012 4:15 pm

Have you a navigation controller on the parent page. You needs it
NimbleKit Registered user U885740601
User avatar
rouillip
NimbleKit Expert
 
Posts: 267
Joined: Wed Jan 13, 2010 9:38 am
Location: Paris 75018 (France)

Re: goBack not working?

Postby paul3252 » Tue Apr 10, 2012 8:29 pm

Thanks both for looking, I have made no changes to the code, but it is now working, so I can only assume that Xcode was having an off day when I posted.
paul3252
 
Posts: 25
Joined: Fri Mar 16, 2012 10:35 pm


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest