Como formatar converter a cadeia 2013-01-27T02: 31: 47 + 08: 00 em NSDate

Eu tentei muitas vezes para converter a string2013-01-27T02:31:47+08:00 em NSDate. Eu encontrei oguia de formatação pela apple e copiou seu código e tentou, mas não funciona.

 NSDateFormatter *rfc3339DateFormatter = [[NSDateFormatter alloc] init];
    NSLocale *enUSPOSIXLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"];

    [rfc3339DateFormatter setLocale:enUSPOSIXLocale];
    [rfc3339DateFormatter setDateFormat:@"yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'"];
    [rfc3339DateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:8]];

    // Convert the RFC 3339 date time string to an NSDate.
    NSDate *date = [rfc3339DateFormatter dateFromString:@"2013-01-27T02:31:47+08:00"];

questionAnswers(2)

yourAnswerToTheQuestion