swift - App opens launch screen but crashes (On iOS Device) -


i having bit of trouble trying test app on physical device. everytime go , test app through testflight opens launchscreen split second crashes. strange because works in simulator.

im not using storyboards , ive read around , people said rid of of main storyboard references in info.plist , build settings. have done , still isn't working.

i have attached screenshots below:

info.plist

enter image description here

build settings

enter image description here

also, have feeling appdelegate due me trying programattically.

appdelegate.swift

@uiapplicationmain class appdelegate: uiresponder, uiapplicationdelegate  {     var window: uiwindow?      func application(application: uiapplication, didfinishlaunchingwithoptions launchoptions: [nsobject: anyobject]?) -> bool      {         // override point customization after application launch.         self.window = uiwindow(frame:uiscreen.mainscreen().bounds)          let navcontroller = uinavigationcontroller()         let mainviewcontroller = viewcontroller(nibname:nil, bundle:nil)          // navigationbar/title colour         navcontroller.navigationbar.titletextattributes = [nsforegroundcolorattributename:uicolor.whitecolor()]         uinavigationbar.appearance().bartintcolor = uicolor(red:3/255, green:60/255, blue:115/255, alpha:1);           // push viewcontroller onto navigation controller         navcontroller.pushviewcontroller(mainviewcontroller, animated:false)          self.window!.rootviewcontroller = navcontroller         self.window?.makekeyandvisible()          return true     }      func applicationwillresignactive(application: uiapplication)      {         // sent when application move active inactive state. can occur types of temporary interruptions (such incoming phone call or sms message) or when user quits application , begins transition background state.         // use method pause ongoing tasks, disable timers, , throttle down opengl es frame rates. games should use method pause game.     }      func applicationdidenterbackground(application: uiapplication)      {         // use method release shared resources, save user data, invalidate timers, , store enough application state information restore application current state in case terminated later.         // if application supports background execution, method called instead of applicationwillterminate: when user quits.     }      func applicationwillenterforeground(application: uiapplication)      {         // called part of transition background inactive state; here can undo many of changes made on entering background.     }      func applicationdidbecomeactive(application: uiapplication)      {         // restart tasks paused (or not yet started) while application inactive. if application in background, optionally refresh user interface.     }      func applicationwillterminate(application: uiapplication)      {         // called when application terminate. save data if appropriate. see applicationdidenterbackground:.     } } 

viewcontroller.swift - viewdidload()

override func viewdidload()      {         super.viewdidload()          self.title = "myapp"         self.view.backgroundcolor = uicolor.whitecolor()         self.navigationcontroller!.navigationbar.bartintcolor = uicolor(red: 0, green: 40/255, blue: 99/255, alpha: 1)         self.navigationcontroller!.navigationbar.tintcolor = uicolor.whitecolor()           // container         maincontainer = uiview()          // button         btn_schedule = uibutton()         btn_career = uibutton()         btn_social = uibutton()         btn_feedback = uibutton()         btn_details = uibutton()          // label         lbl_copywrite = uilabel()          // horizontal dividing lines         dividinglinetop = uiview()         dividinglinebottom = uiview()          // images         img_schedule = uiimage()         img_career = uiimage()         img_social = uiimage()         img_feedback = uiimage()         img_details = uiimage()          img_schedule = uiimage(named:"imgschedule.png")         img_career = uiimage(named:"imgcareer.png")         img_social = uiimage(named:"imgsocial.png")         img_feedback = uiimage(named:"contact.png")         img_details = uiimage(named:"imgdetails.png")          // set button clicks         btn_schedule.addtarget(self, action:"onmyschedulebutton_clicked:", forcontrolevents: uicontrolevents.touchupinside)         btn_career.addtarget(self, action:"onmycareerbutton_clicked:", forcontrolevents: uicontrolevents.touchupinside)         btn_social.addtarget(self, action:"onmysocialbutton_clicked:", forcontrolevents: uicontrolevents.touchupinside)         btn_feedback.addtarget(self, action:"onfeedbackbutton_clicked:", forcontrolevents: uicontrolevents.touchupinside)         btn_details.addtarget(self, action:"onmydetailsbutton_clicked:", forcontrolevents: uicontrolevents.touchupinside)          if uidevice.currentdevice().orientation.islandscape.boolvalue         {             displaymenuinlandscapemode()         }         else          {             if(uidevice.currentdevice().userinterfaceidiom == uiuserinterfaceidiom.pad)             {                 displaymenuinlandscapemode()             }             else             {                 displaymenuinportraitmode()             }         }     } 

if great...been stuck on issue last few days , need project done.

thanks!


Comments