http://code.google.com/p/scm-subversion/source/browse/trunk/iPhone/CalendarTest/?r=4#CalendarTest%253Fstate%253DclosedカレンダーAPIの変更
私は上記のカレンダーAPIを使用しています。 CalendarTestViewController.mクラスでは、日付を取得しています。今では、グローバル変数nsstring型を宣言しました。グローバル変数を使用して、その日付を別の新しいクラスに使用したいと考えています。私はこれを数回試しましたが、出力を得ることができませんでした。誰かがCalendar APIを使用して選択した日付を使用する方法を知っている場合は、私にいくつかの解決策を教えてください。
ありがとうございます。
CODE
- (void)calendarView:(KLCalendarView *)calendarView tappedTile:(KLTile *)aTile{
NSLog(@"Date Selected is %@",[aTile date]);
str=(NSString *)[aTile date];
}
NSLog(@"str:%@",str);
glbdate1 = (NSString *)[aTile date];
NSLog(@"glbdate1:%@",glbdate1);
}
//I have declared the glbdate1 variable globally in app delegate file and i have made the new class calenderview
//I want to display the date in textfield by using global variable. Here is code in calenderview
-(void)viewWillAppear:(BOOL)animated {
if ([glbdate1 length] != 0)
{
from.text = glbdate1;
}
}
uはしようとしたHAVワットのいくつかのコードを追加します。.. – KingofBliss
- (無効)calendarView:(KLCalendarView *)calendarView tappedTile:(KLTile *)aTile { \tのNSLog(@ "選択された日付は%@"、[aTile日付]); \t str =(NSString *)[aTile date];} \t NSLog(@ "str:%@"、str); \t \t glbdate1 =(NSString *)[aTile date];私はglbdate1変数をアプリケーションデリゲートファイルでグローバルに宣言しました。新しいクラスcalenderviewを作成しました。グローバル変数を使用してテキストフィールドに日付を表示したいのですが。ここでは、calenderviewのコードです - (void)viewWillAppear:(BOOL)animated { if([glbdate1 length]!= 0){ \t from.text = glbdate1; } –