NSDateFormatter has some really obscure behavior that I'm sure trips up a lot of people. A case in point. I have an app where a date is sent from the server in the format: "yyyy-MM-dd'T'HH:mm:ssZZ". You would expect that the following code would work just fine:
NSDateFormatter dateFormatter = [[NSDateFormatter alloc] init];[dateFormatter setTimeStyle:NSDateFormatterFullStyle];[dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ssZZ"];NSDateFormatter dateFormatter = [[NSDateFormatter alloc] init];[dateFormatter setLocale:[[[NSLocale alloc]initWithLocaleIdentifier:@"en_US_POSIX"] autorelease]];[dateFormatter setTimeStyle:NSDateFormatterFullStyle];[dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ssZZ"];
UIWebView is great for displaying hightly formated content, but sizing the frame correctly can be tough at times. Recently, I was using a UIWebView to display formated content and I needed to resize it display all of it's contents. The standard way to automatically resize a UIView to fit its contents is to call sizeToFit. Calling sizeToFit on the UIWebView in the -(void)webViewDidFinishLoad:(UIWebView *)webView UIWebViewDelegate method works nicely... almost.