好吧,所以基本上我試圖將標籤鏈接到XCode 4.6.2中的一段代碼。我使用設計器將其鏈接起來,但無論我放在哪裏,它都會給我這個錯誤信息。我是xcode的新手,覺得這應該是一個簡單的修復。感謝您的反饋/程序中意外的「@」
(void)updateLabel {
@property (weak, nonatomic) IBOutlet UILabel *Timer;
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
int units = NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit;
NSDateComponents *components = [calendar components:units fromDate:[NSDate date] toDate:destinationDate options:0];
[dateLabel setText:[NSString stringWithFormat:@"%d%c %d%c %d%c %d%c %d%c", [components month], 'M', [components day], 'D', [components hour], 'H', [components minute], 'M', [components second], 'S']];
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
destinationDate = [[NSDate dateWithTimeIntervalSince1970:1383652800] retain];
timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(updateLabel) userInfo:nil repeats:YES];
}
錯誤消息是什麼???? –
(但在方法定義中不允許使用「@ property」語句,實際上甚至不應該在.m文件中。) –
(實例/屬性名稱應以小寫字母開頭。) –