2014-09-29 106 views
1

我的項目使用UIAlertController。它工作正常,我可以在Xcode 6.1上創建一個IPA文件。使用UIAlertController的項目。如何用Xcode 5.1構建IPA文件?

但是,當我想在Xcode 5.1上生成一個IPA文件。這是不行的,因爲Xcode 5.1無法找到'UIAlertController'的接口聲明。有任何想法嗎?

P/S:抱歉我的英語。

+0

是否有一個原因,你需要在Xcode 5.1中構建而不是Xcode 6.1? – 2014-09-29 04:23:40

+0

你得到這個整理? – 2014-10-01 01:29:17

+1

我想爲iOS 6構建我的項目接受了iOS 6及以上版本。 – TienLe 2014-10-01 03:57:25

回答

0

你不能.. UIAlertController可在Xcode 6和iOS 8的編譯器的Xcode 5.1沒有理解它會給出錯誤

0

如果你想在UIAlertView或UIActionSheet中爲你的iOS 6及以上的項目使用UIAlertController,試試這個。 它在Xcode 7.3和Xcode 5.1中爲我編譯。

Class UIAlertControllerClass = NSClassFromString(@"UIAlertController"); //So that Xcode 5 won't complain about not knowing what is UIAlertController. 

if (UIAlertControllerClass) 
{ 
    #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 //So Xcode 5 won't worry about your UIAlertController code since it was introduced in iOS 8. 

    //UIAlertController code goes here. 

    #endif 
} 
else 
{ 
    //UIAlertView or UIActionSheet code goes here. 
}