views - presentViewController makes black screen Xcode 5.1.1 -



views - presentViewController makes black screen Xcode 5.1.1 -

hello lovely reader,

i've been stuck on 2 days hope help me fixed. blackscreen when switching views xcode 5.1.1. saw problem on stackoverflow no post helped me.

i want switch view connexion view inscription , able switch view inscription view connexion. animation, here code inscriptionviewcontroller.m :

- (ibaction)swipegesturetoright:(uiswipegesturerecognizer *)sender { // switch à la vue de connexion // view that's showing uiview *currentview = self.view; // the underlying uiwindow, or view containing current view uiview *thewindow = [currentview superview]; connexionviewcontroller *vc = [[connexionviewcontroller alloc] init]; uiview *newview = vc.view; // remove current view , replace myview1 [currentview removefromsuperview]; [thewindow addsubview:newview]; // set animation transition between views catransition *animation = [catransition animation]; [animation setduration:0.5]; [animation settype:kcatransitionpush]; [animation setsubtype:kcatransitionfromright]; [animation settimingfunction:[camediatimingfunction functionwithname:kcamediatimingfunctioneaseineaseout]]; [[thewindow layer] addanimation:animation forkey:@"switchview"]; }

and here code connexionviewcontroller :

- (ibaction)swipegesturetoleft:(uiswipegesturerecognizer *)sender { [self dismissviewcontrolleranimated:no completion:nil]; }

what guys think ? can come ?

thanks in advance time , help. :)

ps : tried remove of , replace

connexionviewcontroller *vc = [[connexionviewcontroller alloc] init]; [self presentviewcontroller:vc animated:no completion:nil];

and still black screen.

edit : problem solved. thx help. after 2 days found out.

here solution :

// view that's showing uiview *currentview = self.view; // the underlying uiwindow, or view containing current view uiview *thewindow = [currentview superview]; uistoryboard *storyboard = [uistoryboard storyboardwithname:@"main" bundle:nil]; connexionviewcontroller *vc = [storyboard instantiateviewcontrollerwithidentifier:@"connexionviewcontroller"]; uiview *newview = vc.view; // remove current view , replace myview1 [currentview removefromsuperview]; [thewindow addsubview:newview]; // set animation transition between views catransition *animation = [catransition animation]; [animation setduration:0.5]; [animation settype:kcatransitionpush]; [animation setsubtype:kcatransitionfromright]; [animation settimingfunction:[camediatimingfunction functionwithname:kcamediatimingfunctioneaseineaseout]]; [[thewindow layer] addanimation:animation forkey:@"switchview"];

hey faced same in xcode 5.1.1

instead of presentviewcontroller, faced while pushviewcontroller

problem xcode not able automatically pick controller.xib file in case, added xib name

initially-

self = [super initwithnibname:nibnameornil bundle:nibbundleornil];

after-

self = [super initwithnibname:@"userconversationviewcontroller" bundle:nibbundleornil];

it solves problem, hope solve someone's problem. :)

xcode views screen

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -