Convert NSArray to NSString in Objective-C

后端 未结 9 1287
难免孤独
难免孤独 2020-11-28 01:13

I am wondering how to convert an NSArray [@\"Apple\", @\"Pear \", 323, @\"Orange\"] to a string in Objective-C.

9条回答
  •  一向
    一向 (楼主)
    2020-11-28 01:31

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

    and you have dic or multiple array then used bellow

    NSString * result = [[array valueForKey:@"description"] componentsJoinedByString:@""];   
    

提交回复
热议问题