所以这里是我遇到的麻烦一些代码:返回stringfromdate方法
//format the date to a string for echoing it
NSDateFormatter* formattedDate = [[NSDateFormatter alloc] init];
[formattedDate setDateStyle:NSDateFormatterLongStyle]; //now myFormatted is set to a long style
NSString* dateForOutput = [formattedDate stringFromDate:self.datePickerOutlet.date];
//also now need to set the "you began on" text to the newly chosen date
[self.startDate setText:@"You started on: %@", dateForOutput];
所给出的错误:“参数太多方法调用,预计1,有2个”
我不明白为什么它说我想通过两种方法。 我试图做的情况下,下面我太傻了,但它仍然给了我一个错误:“接口类型不能是静态分配”
坦白说,我不知道为什么它是:给
//format the date to a string for echoing it
NSDateFormatter* formattedDate = [[NSDateFormatter alloc] init];
[formattedDate setDateStyle:NSDateFormatterLongStyle]; //now myFormatted is set to a long style
NSString* dateForOutput = [formattedDate stringFromDate:self.datePickerOutlet.date];
//also now need to set the "you began on" text to the newly chosen date
NSString *foobar = @"You started on: %@", dateForOutput;
[self.startDate setText:foobar];
错误给我这个错误...一些帮助将不胜感激。 这可能只是我只是没有看到由于某些原因小东西=/
欢呼声, 马特
没有u表示日期选择器和创建的UILabel属性..? – userar 2012-01-02 06:30:19