-1

NSDict を NSDate に変換しようとしています。誰かがいくつかの例を提案できますか。

前もって感謝します。

4

1 に答える 1

2
NSSString *str = [dict objectForKey:@"billdate"];
NSDateFormater *f = [[NSDateFormatter alloc] init];

NSLocale *usLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"];
f.locale = usLocale;
f.dateFormat = @"MM/dd/yyyy"; // The format string uses the format patterns from the Unicode Technical Standard #35

NSDate *date = [f dateFromString:str];
于 2013-02-08T08:47:24.977 に答える