ios - iPhone Simulator stucks on launchscreen. Struct issues in Objective-C? -
this first time using struct in objective-c , can't figure out i'd go wrong. let's me explain better:
in "appdata" class have created struct. instance let's suppose containing information market products.
// struct declaration typedef struct { int apple; int banana; int cherry; } products; // variable declaration @property (assign, nonatomic) products products;
the first thing app on startup check if keys exist inside nsuserdefault, update products
(in order easy access values). way try achieve step:
+ (void)update { nsuserdefaults *defaultuser = [nsuserdefaults standarduserdefaults]; products updatedproducts; if ([defaultuser objectforkey:@"apple"] != nil) updatedproducts.apple = [[defaultuser objectforkey:@"apple"] intvalue]; if ([defaultuser objectforkey:@"banana"] != nil) updatedproducts.banana = [[defaultuser objectforkey:@"banana"] intvalue]; if ([defaultuser objectforkey:@"cherry"] != nil) updatedproducts.cherry = [[defaultuser objectforkey:@"cherry"] intvalue]; // update [[appdata shareddata] setproducts:updatedproducts]; // synchronize [defaultuser synchronize]; }
the result of infinite in launch screen (the number of nodes , fps not loaded). tried [appdata shareddata].products = updatedproducts;
nothing changes.
i'm doing wrong can't figure out what. should do? thanks
Comments
Post a Comment