首页 > 移动平台 > 详细

Xcode7,ios9 issue ,warning合集

时间:2016-02-27 17:58:56      阅读:221      评论:0      收藏:0      [点我收藏+]

1.Downcast from ‘UIViewController‘ only unwraps optionals;did you mean to use‘!‘?

原:  let view = mainStory.instantiateInitialViewController() as! UIViewController

  window?.rootViewController = view

修改:

   if let view = mainStory.instantiateInitialViewController(){ 

            window?.rootViewController = view

        }

2.Call can throw, but it is not marked with ‘try‘ and the error is not handled 或者 ambiguous reference to member ‘appendpartwithfileurl‘

原:formData.appendPartWithFileURL(filePath, name: "file")

修改:do {

       try formData.appendPartWithFileURL(filePath, name: "file")

} catch {

// TODO: handle error

}

3.Cannot convert value of type ‘[String : String?]‘ to expected argument type ‘AnyObject?‘

原:

let params = [ "url": urlTf.text ]

修改:let params = [ "url"urlTf.text  ?? "" ]

 

 

 

Xcode7,ios9 issue ,warning合集

原文:http://www.cnblogs.com/-yfan/p/5223142.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!