美文网首页
数组转字符串

数组转字符串

作者: 6e8c584b907c | 来源:发表于2017-06-17 21:45 被阅读0次

1、数组转字符串:

NSString * str= [stringArrcomponentsJoinedByString:@";"];

2、字符串转数组:

NSArray* array = [self.appendStringcomponentsSeparatedByString:@";"];

NSArray*arr1 = [[NSArrayalloc]initWithObjects:@"0",@"5",nil];

NSData*data = [NSKeyedArchiverarchivedDataWithRootObject:arr1];

NSArray*arr2 = [NSKeyedUnarchiverunarchiveObjectWithData:data];

NSLog(@"->%@",[arr1objectAtIndex:1]);

NSLog(@"->%@",[arr2objectAtIndex:1]);

相关文章

网友评论

      本文标题:数组转字符串

      本文链接:https://www.haomeiwen.com/subject/irmbqxtx.html