[英]Can I change (unsigned) to (NSUInteger) or will it create problems?
I am a Jr Software Developer, can I just change the (unsigned) to (NSUInteger) or will to create problems later? 我是一名Jr软件开发人员,可以将(unsigned)更改为(NSUInteger),还是以后再创建问题?
- (unsigned)retainCount
{
return UINT_MAX; //denotes an object that cannot be released
}
warning said 警告说
MKStoreManager.m:88:1: Conflicting return type in implementation of 'retainCount': 'NSUInteger' (aka 'unsigned long') vs 'unsigned int'
I found a previous definition 我找到了先前的定义
- (NSUInteger)retainCount OBJC_ARC_UNAVAILABLE;
Your method must return NSUInteger
because that is how the retainCount
method is defined in NSObject
. 您的方法必须返回
NSUInteger
因为那是在NSObject
定义retainCount
方法的方式。
The error is being caused by the value you are trying to return. 该错误是由您试图返回的值引起的。 Instead of returning
UINT_MAX
, you should return NSUIntegerMax
. 而不是返回
UINT_MAX
,您应该返回NSUIntegerMax
。
The underlying type for NSUInteger
changes depending on whether building for 32 or 64 bit. NSUInteger
的基础类型根据构建32位还是64位而变化。 Accordingly, the value of NSUIntegerMax
also changes to match the type. 因此,
NSUIntegerMax
的值也将更改以匹配类型。
- (NSUInteger)retainCount
{
return NSUIntegerMax; //denotes an object that cannot be released
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.