Monday, December 13, 2010

NSDateFormatter:Convert NSDate to NSString description

Convert a NSDate to string in format "yyyy-MM-dd"

NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd"];
NSString *dateString = [dateFormatter stringFromDate:[NSDate date]];
NSLog(dateString);

Saturday, December 11, 2010

iPhone Simulator (IndigoDevice) Internal Error

I got a strange "Internal Error" when building app with Xcode. Restarting Xcode and my Mac do not help. Finally, I found the solution from JPoz:
http://blog.jpoz.net/2009/05/24/iPhone-simulator-internal-error.html
"go into your (username)/Library/Application Support/ and delete the iPhone Simulator folder. Restart xcode and build your app."
It works fine and help a lot.