javaBin / ems-ios

iOS-app som viser programmet til JavaZone - erstattes fra 2017 med https://github.com/javaBin/appZone
4 stars 0 forks source link

Issue 145 adaptive ui 2 #152

Closed ronnienessa closed 9 years ago

chrissearle commented 9 years ago

OK - I'll have to look at this - so far this morning I just checked it out and built - haven't had time to look thru yet.

One (picky) thing - if we have one storyboard - can we rename it so that it's not called _iPad ?

chrissearle commented 9 years ago

Hmm - installed and ran on my 6+.

Crashed at start:

2015-07-10 07:44:19.574 JavaZone[10495:2765287] Exception occurred restoring state Could not find a storyboard named 'MainStoryboard_iPhone' in bundle NSBundle </private/var/mobile/Containers/Bundle/Application/B0FF50F8-FFE2-4B9B-928A-FA432BA0CADE/JavaZone.app> (loaded)
2015-07-10 07:44:19.576 JavaZone[10495:2765287] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'MainStoryboard_iPhone' in bundle NSBundle </private/var/mobile/Containers/Bundle/Application/B0FF50F8-FFE2-4B9B-928A-FA432BA0CADE/JavaZone.app> (loaded)'
*** First throw call stack:
(0x1856382d8 0x19730c0e4 0x18a672810 0x18a783ac0 0x1864b0d98 0x1864b01b4 0x18a222e40 0x18a222824 0x18a1233c0 0x18a1230c8 0x18a33a7e8 0x18a33d19c 0x18a33b70c 0x18de6d3c8 0x1855f027c 0x1855ef384 0x1855ed9a8 0x1855192d4 0x18a11c3d0 0x18a116f40 0x1000081e0 0x1979b6a08)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

So restore shouldn't crash on upgrade from two storyboard code to one storyboard code.

chrissearle commented 9 years ago

Hmm. Don't know if present pre-pull req or not. 6+ - filter to remove beginner level then start flagging favourites on the list (portrait). Section headers have a tendency to jump around (but always go back to where they should be)

ronnienessa commented 9 years ago

I don´t see it on simulator. Can u make a video?

  1. jul. 2015 kl. 08.14 skrev Chris Searle notifications@github.com:

Hmm. Don't know if present pre-pull req or not. 6+ - filter to remove beginner level then start flagging favourites on the list (portrait). Section headers have a tendency to jump around (but always go back to where they should be)

— Reply to this email directly or view it on GitHub https://github.com/javaBin/ems-ios/pull/152#issuecomment-120244193.

chrissearle commented 9 years ago

Dodgy - hard to hold an iPad and work an iPhone - but https://dl.dropboxusercontent.com/u/102984/JZ.mp4

ronnienessa commented 9 years ago

I don't think it's a problem. We don't do restoration across app upgrades. It will fix it self when you do a release.

Vennlig hilsen Webstep AS

Ronnie Nessa | Seniorkonsulent Tlf: +47 970 69 512 | ronnie.nessa@webstep.no

Den 10. jul. 2015 kl. 07.45 skrev Chris Searle notifications@github.com:

Hmm - installed and ran on my 6+.

Crashed at start:

2015-07-10 07:44:19.574 JavaZone[10495:2765287] Exception occurred restoring state Could not find a storyboard named 'MainStoryboard_iPhone' in bundle NSBundle </private/var/mobile/Containers/Bundle/Application/B0FF50F8-FFE2-4B9B-928A-FA432BA0CADE/JavaZone.app> (loaded) 2015-07-10 07:44:19.576 JavaZone[10495:2765287] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'MainStoryboard_iPhone' in bundle NSBundle </private/var/mobile/Containers/Bundle/Application/B0FF50F8-FFE2-4B9B-928A-FA432BA0CADE/JavaZone.app> (loaded)' * First throw call stack: (0x1856382d8 0x19730c0e4 0x18a672810 0x18a783ac0 0x1864b0d98 0x1864b01b4 0x18a222e40 0x18a222824 0x18a1233c0 0x18a1230c8 0x18a33a7e8 0x18a33d19c 0x18a33b70c 0x18de6d3c8 0x1855f027c 0x1855ef384 0x1855ed9a8 0x1855192d4 0x18a11c3d0 0x18a116f40 0x1000081e0 0x1979b6a08) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb) So restore shouldn't crash on upgrade from two storyboard code to one storyboard code.

— Reply to this email directly or view it on GitHub.

ronnienessa commented 9 years ago

Yeah. I can rename. Just wanted to get it out there. Because storyboard conflicts suck.

Vennlig hilsen Webstep AS

Ronnie Nessa | Seniorkonsulent Tlf: +47 970 69 512 | ronnie.nessa@webstep.no

Den 10. jul. 2015 kl. 07.12 skrev Chris Searle notifications@github.com:

OK - I'll have to look at this - so far this morning I just checked it out and built - haven't had time to look thru yet.

One (picky) thing - if we have one storyboard - can we rename it so that it's not called _iPad ?

— Reply to this email directly or view it on GitHub.

ronnienessa commented 9 years ago

Hmm. Is it the same issue on iPad ? Or other iPhones? I don't have cable here, so cannot test.

Vennlig hilsen Webstep AS

Ronnie Nessa | Seniorkonsulent Tlf: +47 970 69 512 | ronnie.nessa@webstep.no

Den 10. jul. 2015 kl. 10.46 skrev Chris Searle notifications@github.com:

Dodgy - hard to hold an iPad and work an iPhone - but https://dl.dropboxusercontent.com/u/102984/JZ.mp4

— Reply to this email directly or view it on GitHub.

chrissearle commented 9 years ago

Ref restoration - I'm happy that it doesn't restore across an upgrade - but I don't want it to crash - I haven't looked into restoration - does it automatically say "Ah - new version - don't bother" ?

Ref rename - yes - storyboard conflicts suck. I'm holding off editing anything until this is merged :) So rename right now should be OK.

chrissearle commented 9 years ago

Can't test iPad - only iPad I have here isn't mine :( If I can I'll test this evening - but I'll have very limited time - if I can't then the first chance I'll get is Sunday.

ronnienessa commented 9 years ago

Yeah. It won´t event try across app upgrades.

- (BOOL)application:(UIApplication *)application shouldRestoreApplicationState:(NSCoder *)coder {
    NSString *archivedVersion = [coder decodeObjectForKey:UIApplicationStateRestorationBundleVersionKey];
    NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *) kCFBundleVersionKey];

    if (![archivedVersion isEqual:version]) { // Don´t restore across updates
        DDLogInfo(@"Bundle version is: %@, archived version is %@. Skipping state restore.", version, archivedVersion);
        return NO;
    }

    UIUserInterfaceIdiom archivedIdiom = [[coder decodeObjectForKey:UIApplicationStateRestorationUserInterfaceIdiomKey] integerValue];

    UIUserInterfaceIdiom idiom = UI_USER_INTERFACE_IDIOM();

    if (archivedIdiom != idiom) { // Don´t restore if idiom changed. E.g user restored from iPad to iPhone etc.
        DDLogInfo(@"User interface idiom in bundle %ld, does not match current user interface idiom %ld. Skipping state restore.", archivedIdiom, idiom);
        return NO;
    }

    NSString *archivedSystemVersion = [coder decodeObjectForKey:UIApplicationStateRestorationSystemVersionKey];

    NSString *systemVersion = [UIDevice currentDevice].systemVersion;

    if (![archivedSystemVersion isEqual:systemVersion]) { // Don´t restore across system versions
        DDLogInfo(@"System version in archive %@ does not match current system version %@. Skipping state restore.", archivedSystemVersion, systemVersion);
        return NO;
    }

    return YES;
}
ronnienessa commented 9 years ago

Did you manage to test some more on this? Would be nice to get it merged before any other changes are made.