作者fishead1116 (DD魚)
看板MacDev
標題[問題] swift 2.0 available
時間Thu Sep 17 10:41:42 2015
我原本 swift 1.2是這樣寫的
class ViewController : UIViewController{
var alertController : UIAlertController?
}
但是到了2.0顯示
UIAlertController is only available on iOS 8.0 or newer
XCode給我的提示是在class前面加上 @available(iOS 8.0, *)
有個疑問是這樣會不會導致整個class只有在8.0以後才看得到
第二個問題是有沒有其他方法可以改掉這邊的error
謝謝大家
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 118.163.221.141
※ 文章網址: https://www.ptt.cc/bbs/MacDev/M.1442457709.A.B5C.html
推 densms: 是因為你專案設定 Deployment Target 設在 iOS 8 之前 09/17 10:47
→ fishead1116: 可是我Target必須設在7.1 09/17 10:50
推 sdyy: UIAlertController本來就只能用在ios8.0以上吧 09/17 21:06
→ sdyy: 依照3F那篇就可 09/17 21:07
→ fishead1116: 因為我8以下用UIAlertView , 8.0以後用controller 09/18 08:10