简体   繁体   中英

Compiler warning about “Semantic Issue” — how to fix?

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;

...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM