In my learning book, objective-c for absolute beginners, is written the following example
The second line is giving me problems in that dateWithString doesn't seem to be a method of the NSDate class. Using google I learned that that is only available on the OS X version of the class.
So I resolved it as follows
Is this the best and fastest way to do so ?
Code:
NSDate *today = [NSDate date];
NSDate *saleDate = [NSDate dateWithString:@"2011-12-04 04:00:00 -700"];
The second line is giving me problems in that dateWithString doesn't seem to be a method of the NSDate class. Using google I learned that that is only available on the OS X version of the class.
So I resolved it as follows
Code:
NSDate *saleDate = [[[NSDateFormatter alloc] init] dateFromString:@"2011-12-04 04:00:00 -700"];
Is this the best and fastest way to do so ?