{"Title":"Chatroom","Year":"2010","Rated":"R","Released":"11 Aug 2010","Genre":"Drama, Thriller","Director":"Hideo Nakata","Writer":"Enda Walsh, Enda Walsh","Actors":"Aaron Johnson, Imogen Poots, Matthew Beard, Hannah Murray","Plot":"A group of teenagers encourage each other's bad behavior.","Poster":"http://ia.media-imdb.com/images/M/MV5BMjE0MjM5MDM2MF5BMl5BanBnXkFtZTcwMzg1MzY0Mw@@._V1._SX320.jpg","Runtime":"1 hr 37 mins","Rating":"5.3","Votes":"1000","ID":"tt1319704","Response":"True"}

我用nsstring获得此数据,而我的问题是如何拆分与另一个nsstrings分离的数据,但我想将这么多nsstrings用作逗号。

最佳答案

使用以下

NSString *str; //Pass your string to str
NSArray *array = [str componentsSeparatedByString:@","];

for(int i = 0; i < [array count]; i++) {
  // Here just take strings one by one
}

关于xcode - xcode将NSString拆分为其他NSString,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8256080/

10-11 23:27
查看更多