root / trunk / data / gdata-objectivec-client / formatter.diff

Revision 268, 1.2 kB (checked in by saurik, 7 months ago)

Added GData client APIs.

  • Source/Networking/GDataHTTPFetcherLogging.m

    diff -ru gdata-objectivec-client-129/Source/Networking/GDataHTTPFetcherLogging.m gdata-objectivec-client-129+iPhone/Source/Networking/GDataHTTPFetcherLogging.m
    old new  
    160160  if (!gLoggingDateStamp) {     
    161161    // produce a string like 08-21_01-41-23PM 
    162162     
    163     NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease]; 
    164     [formatter setFormatterBehavior:NSDateFormatterBehavior10_4]; 
    165     [formatter setDateFormat:@"M-dd_hh-mm-ssa"]; 
    166      
    167     gLoggingDateStamp = [[formatter stringFromDate:[NSDate date]] retain] ;     
     163    CFLocaleRef locale = CFLocaleCopyCurrent(); 
     164    CFDateFormatterRef formatter = CFDateFormatterCreate(NULL, locale, kCFDateFormatterNoStyle, kCFDateFormatterNoStyle); 
     165    CFRelease(locale); 
     166     
     167    CFDateFormatterSetFormat(formatter, CFSTR("M-dd_hh-mm-ssa")); 
     168    gLoggingDateStamp = (NSString *) CFDateFormatterCreateStringWithDate(NULL, formatter, (CFDateRef) [NSDate date]); 
     169    CFRelease(formatter); 
    168170  } 
    169171  return gLoggingDateStamp; 
    170172} 
Note: See TracBrowser for help on using the browser.