iOS 零散知识点

1.时间转换代码

NSString *string = [ditc objectForKey:@"loadGoodsEndDt"];

NSDateFormatter *inputFormatter = [[NSDateFormatter alloc] init];

[inputFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]];

[inputFormatter setDateFormat:@"yyyy-MM-dd HH:mm"];

NSDate* inputDate = [inputFormatter dateFromString:string];

NSLog(@"date = %@", inputDate);

NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init] ;

[outputFormatter setLocale:[NSLocale currentLocale]];

[outputFormatter setDateFormat:@"yyyy年MM月dd日 HH时mm分"];

NSString *str = [outputFormatter stringFromDate:inputDate];

NSLog(@"testDate:%@", str);

2.应用开启 http 请求代码

    NSAppTransportSecurity

   

        NSAllowsArbitraryLoads

       

   









你可能感兴趣的:(iOS 零散知识点)