swift - unexpected nil window in _UIApplicationHandleEventFromQueueEvent, _windowServerHitTestWindow: -


i tried make facebook login function in login page. failed first time, (here code)

when try make facebook login in app, "message = "(#100) graph api app id 1xxxxxxxxx called, token has app id 4xxxx851";" error

then made again in same way, time, have different type of error.

it can built, doesn't show ui. display black.

when touch blacked display shows,

2015-09-21 01:42:34.419 nona_app[3327:624143] unexpected nil window in _uiapplicationhandleeventfromqueueevent, _windowserverhittestwindow: ; layer = >

this.

what wrong p.list or code? , how can solve error?

here login page , p.list code.

import uikit import parse class customloginviewcontroller: uiviewcontroller {  @ibaction func facebooklogin(sender: anyobject) {     pffacebookutils.logininbackgroundwithreadpermissions(["public_profile", "email"]) {         (user: pfuser?, error: nserror?) -> void in          if(fbsdkaccesstoken.currentaccesstoken() != nil)         {             let mainpage = self.storyboard?.instantiateviewcontrollerwithidentifier("mainhometvc") as! mainhometvc              let mainpagenav = uinavigationcontroller(rootviewcontroller: mainpage)              let appdelegate = uiapplication.sharedapplication().delegate as! appdelegate              appdelegate.window?.rootviewcontroller = mainpage         }          //if let user = user {          //   if user.isnew {                 print("user signed , logged in through facebook!")          //   } else {                 print("user logged in through facebook!")           //  }         //} else {         //    print("uh oh. user cancelled facebook login.")        // }     }   } @iboutlet weak var usernamefield: uitextfield! @iboutlet weak var passwordfield: uitextfield!  var actind : uiactivityindicatorview = uiactivityindicatorview(frame: cgrectmake(0, 0, 150, 150)) uiactivityindicatorview  override func viewdidload() {     super.viewdidload()  self.actind.center = self.view.center     self.actind.hideswhenstopped = true     self.actind.activityindicatorviewstyle = uiactivityindicatorviewstyle.gray      view.addsubview(self.actind) }  override func didreceivememorywarning() {     super.didreceivememorywarning()     // dispose of resources can recreated. }  @ibaction func loginaction(sender: anyobject) {      let username = self.usernamefield.text     let password = self.passwordfield.text      if (username?.utf16.count < 4 || password?.utf16.count < 5) {         let alert = uialertview(title: "invalid", message: "username must greater 4 , password must greater 5.", delegate: self, cancelbuttontitle: "ok")          alert.show()     } else {         self.actind.startanimating()          pfuser.loginwithusernameinbackground(username!, password: password!, block: { (user, error) -> void in             self.actind.stopanimating()              if((user) != nil) {                  let alert = uialertview(title: "success", message: "logged in", delegate: self, cancelbuttontitle: "ok")                  alert.show()              }else {                 let alert = uialertview(title: "error", message: "\(error)", delegate: self, cancelbuttontitle: "ok")                  alert.show()              }          })       }  }   }              <?xml version="1.0" encoding="utf-8"?>     <!doctype plist public "-//apple//dtd plist 1.0//en"              "h    ttp://www.apple.com/dtds/propertylist-1.0.dtd">   <plist version="1.0">     <dict>         <key>cfbundleurltypes</key>     <array>         <dict>             <key>cfbundleurlschemes</key>             <array>                 <string>fb1686861514879500</string>             </array>         </dict>     </array>     <key>facebookappid</key>     <string>16866861514879500</string>     <key>facebookdisplayname</key>     <string>bany</string>     <key>nsapptransportsecurity</key>     <dict>         <key>nsexceptiondomains</key>         <dict>             <key>facebook.com</key>             <dict>                 <key>nsincludessubdomains</key>                 <true/>                 <key>nsexceptionrequiresforwardsecrecy</key>                 <false/>             </dict>             <key>fbcdn.net</key>             <dict>                 <key>nsincludessubdomains</key>                 <true/>                 <key>nsexceptionrequiresforwardsecrecy</key>                 <false/>             </dict>             <key>akamaihd.net</key>             <dict>                 <key>nsincludessubdomains</key>                 <true/>                 <key>nsexceptionrequiresforwardsecrecy</key>                 <false/>             </dict>         </dict>     </dict>     <key>lsapplicationqueriesschemes</key>     <array>         <string>fbapi</string>         <string>fb-messenger-api</string>         <string>fbauth2</string>         <string>fbshareextension</string>     </array>     <key>cfbundledevelopmentregion</key>     <string>en</string>     <key>cfbundleexecutable</key>     <string>$(executable_name)</string>     <key>cfbundleidentifier</key>     <string>$(product_bundle_identifier)</string>     <key>cfbundleinfodictionaryversion</key>     <string>6.0</string>     <key>cfbundlename</key>     <string>$(product_name)</string>     <key>cfbundlepackagetype</key>     <string>bndl</string>     <key>cfbundleshortversionstring</key>     <string>1.0</string>     <key>cfbundlesignature</key>     <string>????</string>     <key>cfbundleversion</key>     <string>1</string> </dict> 


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -