startdateとenddateを追加したいので、 startdateとenddateの両方に異なるdatecontroller クラスを作成しました。
初めて入ったときは調子が良く、データベースにもちゃんと保存されています。しかし、更新してからメッセージの保存をクリックすると、コードに警告メッセージブロックが表示されます。開始日を終了日の値以下にする必要があります。
これは私のコードで、データベース テーブルに値を挿入したときに初めて機能します。更新して保存ボタンをクリックすると、その条件がチェックされ、その値でデータベースの古い値の開始日と終了日が取得され、この問題を解決する方法は?
私が戻ってきたとき、私はこれを着ますNSLog
message 2012-08-07 14:21:08.047 People[17111:207] *****:2012-08-06 18:30:00 +0000
2012-08-07 14:22:54.752 People[17111:207] *****:2012-08-06 18:30:00 +0000
私のコード:-
-(IBAction)plusSignTapped:(id)sender
{
NSComparisonResult result = [firstobj.StartDate compare: firstobj.EndDate];
NSLog(@"*****:%@", firstobj.StartDate);
NSLog(@"*****:%@", firstobj.EndDate);
if( result == NSOrderedDescending || result==NSOrderedSame)
{
UIAlertView* alert=[[UIAlertView alloc] initWithTitle:@"test" message:@"End date should be greater than or equal to start date " delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
return;
}
}