NimbleKit - fast iOS app development

Nimblekit 1.5.8 alfa 2

Beta versions of NimbleKit and related discussion

Nimblekit 1.5.8 alfa 2

Postby sunny » Sat Sep 19, 2009 2:26 pm

As many of you requested to fix "white screen" on initial application loading I decided to include fix for this in 1.5.8 release.
This is very specific bugfix so I want to ask you to test it before I release, thank you.

As usually for betas to install you have to unzip attached archive and copy the contents to /Library/Frameworks/
then open Xcode and click in main menu "Xcode->Empty caches" and "Build->Clean All Targets"

Also NimbleKit template will be modified after release, but for now to test it you will have to modify you APP_NAME_Delegate.m file in your project:
1. Locate @implementation NimbleAppDelegate in the file and right before this line insert extern BOOL _mainWebViewLoaded;
2. In the method - (void)applicationDidFinishLaunching:(UIApplication *)application locate line [nimble release]; and right after it insert
Code: Select all
while (!_mainWebViewLoaded) {
      [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1]];
   }   


After this you should see Default.png file during app is loaded and when it disappears you should see you main application screen fully loaded, also be aware that if you load something from the internet it may take a lot of time and the default screen will still remain on the top which can make user think the app has freeze so please avoid using internet connection on the main application screen
Attachments
1.5.8.zip
(617.11 KiB) Downloaded 129 times
User avatar
sunny
Staff
 
Posts: 2666
Joined: Sat May 30, 2009 5:18 am
Location: Palo Alto, California

Re: Nimblekit 1.5.8 alfa 2

Postby sunny » Sat Sep 19, 2009 4:29 pm

Also using the kind of preloading you can also launch asynchronous preload of other static pages, for instance if you use jquery you could see white screen too when you move to the page first time. To avoid this you can preload page. To do that just insert to your - (void)applicationDidFinishLaunching:(UIApplication *)application method code:
Code: Select all
[[NSClassFromString(@"NKBridge") sharedInstance] performSelector:@selector(webViewForPage:) withObject:@"pagetopreload.html"];
right before [nimble release]; You can preload as many pages as you want, but they all load asynchronous in background, preloading many pages can affect performance.
User avatar
sunny
Staff
 
Posts: 2666
Joined: Sat May 30, 2009 5:18 am
Location: Palo Alto, California

Re: Nimblekit 1.5.8 alfa 2

Postby blazeman » Sat Sep 19, 2009 4:40 pm

When I add the code to the appdelagate file I never get past the default.png

Here's what I have for the top of my file


Code: Select all
extern BOOL _mainWebViewLoaded;
@implementation MyAppDelegate

@synthesize window;


- (void)applicationDidFinishLaunching:(UIApplication *)application {
   while (!_mainWebViewLoaded) {
      [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1]];
   }
   
   Nimble *nimble = [[Nimble alloc] initWithRootPage:@"main.html" window:window serial:@"XXXX-XXXX-XXXX-XXXX"];
   [window addSubview:nimble.view];
   [window makeKeyAndVisible];
   [nimble release];
}


Am I missing something or do something wrong?

On a different note... I can now play ALL of my companies AAC files... so once 1.5.8 goes gold... I get to start cranking apps out :)
User avatar
blazeman
NimbleKit Expert
 
Posts: 712
Joined: Sat May 30, 2009 5:58 pm

Re: Nimblekit 1.5.8 alfa 2

Postby sunny » Sat Sep 19, 2009 4:45 pm

yes, the lines order is wrong in you code, see my delegate file as example:
Code: Select all
#import "NimbleAppDelegate.h"
#import "Nimble.h"

extern BOOL _mainWebViewLoaded;
@implementation NimbleAppDelegate
@synthesize window;
- (void)applicationDidFinishLaunching:(UIApplication *)application {   
   Nimble *nimble = [[Nimble alloc] initWithRootPage:@"main.html" window:window serial:@""];
   [window addSubview:nimble.view];
   [window makeKeyAndVisible];
   [nimble release];
   while (!_mainWebViewLoaded) {
      [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1]];
   }   
}
- (void)applicationWillTerminate:(UIApplication *)application
{
   [[NSClassFromString(@"NKBridge") sharedInstance] performSelector:@selector(onApplicationQuit)];
}
- (void)dealloc {
    [window release];
    [super dealloc];
}
@end

also make sure you added extern BOOL _mainWebViewLoaded; in the exact place like in my file
User avatar
sunny
Staff
 
Posts: 2666
Joined: Sat May 30, 2009 5:18 am
Location: Palo Alto, California

Re: Nimblekit 1.5.8 alfa 2

Postby HalfMoon » Sat Sep 19, 2009 4:56 pm

Tried this on 2 apps.

First app with 2 pages works perfectly - and the preload functionality is perfect. :D

Second app uses a NKTabBarController with 4 tabs & NKNavigationController on first page. When app loads again all is fine but when I go to another page the NavController setTitle function seems to be broken - ie no title is displayed on the nav bar at the top of the page.
User avatar
HalfMoon
NimbleKit Guru
 
Posts: 662
Joined: Thu Jun 04, 2009 6:21 pm
Location: Brighton, UK

Re: Nimblekit 1.5.8 alfa 2

Postby sunny » Sat Sep 19, 2009 5:00 pm

I'm working on navigation controller now, it may be broken now... also try not to preload pages if it still be not working then yeah, just alfa issue to be fixed soon
User avatar
sunny
Staff
 
Posts: 2666
Joined: Sat May 30, 2009 5:18 am
Location: Palo Alto, California

Re: Nimblekit 1.5.8 alfa 2

Postby blazeman » Sat Sep 19, 2009 5:03 pm

thanks sunny... that fixed it for me :)
User avatar
blazeman
NimbleKit Expert
 
Posts: 712
Joined: Sat May 30, 2009 5:58 pm

Re: Nimblekit 1.5.8 alfa 2

Postby razilon » Mon Sep 28, 2009 4:24 pm

This works perfectly for me if I compile against OS 3.0 or above, but not if I compile for OS 2.2.1. Is there a quick fix for that? Or is 2.2.1 just a bad idea?
razilon
 
Posts: 31
Joined: Mon Jun 22, 2009 5:50 pm

Re: Nimblekit 1.5.8 alfa 2

Postby blazeman » Mon Sep 28, 2009 4:47 pm

razilon wrote:This works perfectly for me if I compile against OS 3.0 or above, but not if I compile for OS 2.2.1. Is there a quick fix for that? Or is 2.2.1 just a bad idea?


Is this on Xcode 3.1 or 3.2? By default 2.2.1 isn't installed any more. You need to select it when installing the SDK.
User avatar
blazeman
NimbleKit Expert
 
Posts: 712
Joined: Sat May 30, 2009 5:58 pm

Re: Nimblekit 1.5.8 alfa 2

Postby blazeman » Mon Sep 28, 2009 4:48 pm

I think I read your post wrong Sorry.

Mine is working fine for 2.2.1.

What are your errors?
User avatar
blazeman
NimbleKit Expert
 
Posts: 712
Joined: Sat May 30, 2009 5:58 pm

Next

Return to Beta Versions

Who is online

Users browsing this forum: No registered users and 0 guests