数组转字符串

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]);

你可能感兴趣的:(数组转字符串)