当地宣布日期格式'隐藏实例变量?

时间:2015-03-16 21:55:19

标签: ios objective-c

为这三个陈述获取7条警告信息:

 // And grab those date components for the same date
    hijriComponents = [hijriCalendar components:(NSDayCalendarUnit |
                                                 NSMonthCalendarUnit |
                                                 NSYearCalendarUnit)
                                       fromDate:[NSDate date]
                                         ];

  [dateFormat setDateFormat:@"d/M/yyyy"];
    NSDate *dateee = [dateFormat dateFromString:dateStr];

self.gDayLabel.text   = [NSString stringWithFormat: @"%ld", (long)[gregorianComponents day]];
self.gMonthLabel.text = [NSString stringWithFormat: @"%ld", (long)[gregorianComponents month]];
self.gYearLabel.text  = [NSString stringWithFormat: @"%ld", (long)[gregorianComponents year]];

1 个答案:

答案 0 :(得分:0)

检查XYZViewController.h文件。 dateFormat在那里被声明为属性。然后在该方法中它还有一个具有相同名称的局部变量。重命名局部变量或使用全局变量。 - Midhun MP 6分钟前