简体   繁体   English

类不可用。 在6.0之前的iOS版本上无法使用取消同步功能

[英]Class Unavailable. Unwind segues are not available on iOS versions prior to 6.0

I'm trying to use unwind segues in an existing iOS project, and ran into this error - "Class Unavailable. Unwind segues are not available on iOS versions prior to 6.0.". 我试图在现有的iOS项目中使用解散键,并遇到此错误-“类不可用。解散键在6.0之前的iOS版本上不可用。”。 I've set my deployment target to "7.1" and build SDK to "Latest iOS (iOS 7.1)". 我已将部署目标设置为“ 7.1”,并将SDK构建为“最新的iOS(iOS 7.1)”。

What am I missing? 我想念什么? Why does xcode think I'm trying to build for < 6.0? 为什么xcode认为我要针对<6.0进行构建?

Even though IB is now integrated into Xcode, it was originally its own program and it is still its own compile step. 即使IB现在已经集成到Xcode中,它仍然是它自己的程序,仍然是它自己的编译步骤。 Because of that, you can target individual storyboards and nibs with specific file formats (what version of Xcode can open these) and specific deployment targets (what version of iOS or OS X will run these). 因此,您可以使用特定的文件格式(哪种版本的Xcode可以打开这些文件)和特定的部署目标(哪些版本的iOS或OS X可以运行这些文件)来定位各个故事板和笔尖。

It's always important to make sure that your storyboard or xib file is targeted to the same release as your app, unless you're dynamically loading them. 除非动态加载它们,否则确保故事板或xib文件的目标版本与您的应用程序相同始终很重要。 In which case you may have a storyboard that gets loaded on iOS 7 and a different storyboard that gets loaded—perhaps with less features—on iOS 6 or before. 在这种情况下,您可能有一个故事板要在iOS 7上加载,而另一个故事板要在iOS 6或更低版本上加载(也许功能较少)。 Then these storyboards could be targeted to those deployment targets individually, and will warn or cause errors when certain, unavailable features are used. 然后,这些情节提要板可以分别针对那些部署目标,并在使用某些不可用的功能时警告或引起错误。

I don't know for sure, but I think there are sometimes some older templates that target certain xib or storyboard files to something like iOS 6, so always check for that! 我不确定,但是我认为有时有些较旧的模板会将某些xib或Storyboard文件定位到iOS 6之类的东西,所以请务必进行检查!

To check, select the IB document you're interested in, open the inspector window and select the file inspector (CMD+ALT+2), and check the Interface Builder Document section. 要进行检查,请选择您感兴趣的IB文档,打开检查器窗口并选择文件检查器(CMD + ALT + 2),然后检查“ Interface Builder文档”部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM