开发者

Compiler warning about "Semantic Issue" -- how to fix?

开发者 https://www.devze.com 2023-03-14 04:42 出处:网络
I receive this warning when building my app: warning: Semantic Issue: Local declaration of \'datePicker开发者_如何学运维\' hides instance variable

I receive this warning when building my app:

warning: Semantic Issue: Local declaration of 'datePicker开发者_如何学运维' hides instance variable

What does this mean and how do I fix it?


You probably have a method with parameter named datePicker. This method is located in a class which has a field with the same name.

You need to change a name of one of these variables to get rid of this warning.


rename your ivars like this:

@interface SomeClass{
  NSString * _datePicker;
}
@property (nonatomic,retain) NSString * datePicker;
@end

@implementation SomeClass

@synthesize datePicker =_datePicker;

...
0

精彩评论

暂无评论...
验证码 换一张
取 消