开发者

How to use datePicker when selected with an button to display text in a text view

Iam trying to have text displayed in a txt view when the date is picked by a button in a date picker....so when the date picker is on jan 30,2010 (or what every date y开发者_如何学Goou want) you press the select button and the sentence for that day (or what ever day you pick) pops up in the txt view..... each sentence is different for each day Doing the code in Xcode for iPad

Any help is greatly appreciated


get the date from date picker on a button event in a string as -

NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"dd-MM-yyyy hh:mm a"];
NSString *dateStr = [[dateFormatter stringFromDate:[datePickerView date]] retain];

then set this string to a label as -

[label setText:dateStr];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜