ios - UIViewController not loading -


so have log in function goes parse , validates log in. when returns present different view following code.

 var storyboard: uistoryboard = uistoryboard(name: "main", bundle: nil);  var vc: uiviewcontroller = storyboard.instantiateviewcontrollerwithidentifier("profileview") uiviewcontroller  println("got here");  self.presentviewcontroller(vc, animated: true, completion: nil);  println("got here too"); 

got here prints console got here not, view did load function profileview never gets called. there no errors in log , no warnings during compilation. application not crash can keep trying log in never load next view or print second message.

the code did work altered profileview little bit , stops. have reverted view , still broken, have cleaned , rebuilt. there should looking specifically?

upon request here top lines of profileview.

class profileview: uiviewcontroller, uicollectionviewdelegate, uicollectionviewdatasource, uiimagepickercontrollerdelegate, uinavigationcontrollerdelegate {  @iboutlet weak var profileimage: uiimageview! var profilepic: pfobject! var imagearray: [pfobject]! 

when instantiate objects init method init method run , can break point view not load cause never hit break point on first line of viewdidload.

it looks storyboard identifier not set profileview in interface builder. also, in event want set profile view controller specific properties, shouldn't cast uiviewcontroller instead use class of profile view controller

it might have uistoryboard extension loads view controllers via helper methods e.g.

extension uistoryboard {    class func loadprofileviewcontroller() -> profileviewcontroller {       let storyboard = uistoryboard(name: "main", bundle: nil)       return storyboard.instantiateviewcontrollerwithidentifier("profileview") as! profileviewcontroller   }  } 

this way can write let profilevc = uistoryboard.loadprofileviewcontroller()


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -