当前位置: 动力学知识库 > 问答 > 编程问答 >

ios - Deprecation of the enum UITextAlignment in favor of NSTextAlignment in iOS6

问题描述:

While compiling my app for iOS6 I get the following deprecation message:

From iOS 6 and later UITextAlignmentCenter is deprecated. Use NSTextAlignmentCenter instead.

Easy fix I thought, but it seems that NSTextAlignment is available in iOS 6.0 and later, and I also still want to support iOS 5. What is best practice to solve this problem?

Should I check which iOS the user is running and then use NSTextAlignment or UITextAlignment based on that?

网友答案:

Deprecated means just that - its going away in the future. If it were me, I'd just wait til your app is going to be iOS6 or newer (I assume in the next year you will do that). Its extremely unlikely for Apple to remove it before Xcode stops supporting the older release its needed in.

分享给朋友:
您可能感兴趣的文章:
随机阅读: