Ios 为什么只有当我的iPhone未连接到Mac时才会出现警告?

Ios 为什么只有当我的iPhone未连接到Mac时才会出现警告?,ios,iphone,xcode,compiler-warnings,Ios,Iphone,Xcode,Compiler Warnings,不是重复的,但警告消息相同。我读了这篇文章,但没用 我没有使用性能选择器,但我收到的警告与使用时的警告相同 Xcode 6.3中的警告消息是 PerformSelector may cause a leak because its selector is unknown 代码是 NSString *string=[NSString stringWithFormat:@"%tu", data.length]; NSLog(@" Expected :%lli",[response expect

不是重复的,但警告消息相同。我读了这篇文章,但没用

我没有使用性能选择器,但我收到的警告与使用时的警告相同

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应返回一个整数

expectedContentLength是一个long

当我将%tu更改为%zu时,会收到一条新的警告消息

 Values of type 'NSUInteger' should not be used as format arguments; add an explicit cast to 'unsigned long' instead

警告是关于
NSUInteger
大小的变化,这取决于CPU体系结构,并且可能只在发布版本中出现(我理解为“未连接到Mac”),因为发布版本包含所有有效的CPU体系结构(32位和64位),而调试构建只包含用于调试的设备的体系结构。(如果未更改默认的生成设置,则为真)

NSUInteger
改变大小时,假设它是
无符号长的
,并强制使用强制转换:

NSString *string=[NSString stringWithFormat:@"%lu", (unsigned long)data.length];

因为在构建设置中,已将“构建活动体系结构”设置为“是”。警告与32位与64位体系结构相关,您使用的格式参数无效。我的所有设置都是默认设置。我应该为expectedContentLength强制转换什么?它的数据类型是什么?long long是数据类型您根本不需要强制转换它。