我看到一些UIStringDrawing方法已被更新为使用NSLineBreakMode代替UILineBreakMode在iOS的6.0:
如
- (CGSize)sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size lineBreakMode:(NSLineBreakMode)lineBreakMode
我如何检查是为了确保我的iOS 5用户和下面继续使用UILineBreakMode?
我看到一些UIStringDrawing方法已被更新为使用NSLineBreakMode代替UILineBreakMode在iOS的6.0:
如
- (CGSize)sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size lineBreakMode:(NSLineBreakMode)lineBreakMode
我如何检查是为了确保我的iOS 5用户和下面继续使用UILineBreakMode?
没有检查是必要的。 这些只是枚举和它们映射到相同的值
你可以看到这里没有真正的差别:
UILineBreakMode VS NSLineBreakMode
enum {
NSLineBreakByWordWrapping = 0,
NSLineBreakByCharWrapping,
NSLineBreakByClipping,
NSLineBreakByTruncatingHead,
NSLineBreakByTruncatingTail,
NSLineBreakByTruncatingMiddle
};
typedef NSUInteger NSLineBreakMode
typedef enum {
UILineBreakModeWordWrap = 0,
UILineBreakModeCharacterWrap,
UILineBreakModeClip,
UILineBreakModeHeadTruncation,
UILineBreakModeTailTruncation,
UILineBreakModeMiddleTruncation,
} UILineBreakMode;
UILineBrakeMode在iOS6的弃用http://developer.apple.com/library/ios/#documentation/uikit/reference/NSString_UIKit_Additions/Reference/Reference.html#//apple_ref/doc/c_ref/UILineBreakMode