isEqualToDate:
日付を比較して、同じかどうかを返します
-(BOOL)isEqualToDate:(NSDate *)anotherDate:
解説
日付を比較して、同じかどうかを返します。
返り値
( BOOL )
YES/NO
引数
( NSDate * )anotherDate
時間
フレームワーク
Foundation
クラス
NSDate
Instance Methods
使用可能
10.0
参照
-compare:
-earlierDate:
-isEqual:(NSObject protocol)
-laterDate:
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSDate *theDate1 = [NSDate dateWithString:@"2002-12-03 04:56:00 +0900"]; NSDate *theDate2 = [NSDate dateWithString:@"2002-12-03 04:56:00 +0900"]; if ([theDate1 isEqualToDate:theDate2]){ NSLog(@"YES"); }else{ NSLog(@"NO"); } } @end