【发布时间】:2014-02-21 07:00:57
【问题描述】:
我正在将我的 iOS 应用程序转换为 64 位。我安装了最新的 Xcode 5.1(beta 4)。
当我编译应用程序时,我收到了 100 多个警告,其中大部分都很容易修复。但是,我对以下代码有警告:
+ (CommentResponseStatus)commentReponseStatusCodeWithStatusString:(NSString *)_status
{
NSArray *commentStatusString = [NSArray arrayWithObjects:@"success", @"needConfirmation", @"stopped", nil];
return [commentStatusString indexOfObject:_status];
}
CommentResponseStatus 声明为:
typedef enum {
success,
needConfirmation,
stopped
} CommentResponseStatus;
我有一个警告“隐式转换失去整数精度:'NSUInteger'(又名'unsigned long')到'CommentResponseStatus'”
警告上线return [commentStatusString indexOfObject:_status];
在NSArray 我们有- (NSUInteger)indexOfObject:(id)anObject;
我对这个警告感到困惑,现在不知道如何解决它。任何快速帮助将不胜感激。
【问题讨论】:
标签: ios objective-c enums 64-bit