开发者

How to separate value in NSMutableArray in iphone [closed]

开发者 https://www.devze.com 2023-03-24 07:59 出处:网络
It's difficult to tell what is bei开发者_运维知识库ng asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current for
It's difficult to tell what is bei开发者_运维知识库ng asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

My NsmutableArray having value like

myArray = "1,2,3,4,5....10";

these are comes from server. i want to separate it like

myarray = 1
          2
          3
          .
          .
          .
          10

how can i do this.


I guess this link will help you.

The response from the server would be NSString. Split that with the separator.


your response would be in NSString

// it will remove the double qoutes from your response
NSString *temp = [responseString stringByReplacingOccurrencesOfString:@"\"" withString:@""]; 

// gives a array of 1 2 3 ...
NSArray *aArray = [temp componentsSeparatedByString:@","];

hope it helps you...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号