【发布时间】:2015-06-30 12:56:54
【问题描述】:
不是重复,但警告消息是相同的。我读了这篇文章,但没有帮助。
performSelector may cause a leak because its selector is unknown
我没有使用 performSelector,但我收到的警告与使用时相同。
Xcode 6.3 中的警告信息是
PerformSelector may cause a leak because its selector is unknown
代码是
NSString *string=[NSString stringWithFormat:@"%tu", data.length];
NSLog(@" Expected :%lli",[response expectedContentLength]);
data.length 应该返回一个 NSUInteger
expectedContentLength 是 long long
当我将 %tu 更改为 %zu 时,我收到一条新的警告消息
Values of type 'NSUInteger' should not be used as format arguments; add an explicit cast to 'unsigned long' instead
【问题讨论】:
-
因为在您的 Build Settings 中,您将 Build Active Architecture 设置为 YES。该警告与 32 位和 64 位架构有关,并且您使用了无效的格式参数。
标签: ios iphone xcode compiler-warnings