how to split a string - iPhone | Coding Cluster - using asp.net, c#, mvc 4, iphone, php, ios, javascript, in asp.net mvc 3 & more
 

how to split a string - iPhone

Tuesday

How to split items in a string separated by comma:
                                                         You can split a string by  using NString's componentsSeparatedByString method in iphone sdk.

Code:
 NSString *strPasscode = @"A,B,C,D";  
 NSArray *arr = [strPasscode componentSeparatedBy:@","];  
 passcodeTxt1.text = [arr objectAtIndex:0];  
 passcodeTxt2.text = [arr objectAtIndex:1];
 passcodeTxt3.text = [arr objectAtIndex:2];
 passcodeTxt4.text = [arr objectAtIndex:3];
 




0 comments:

Post a Comment

Share your thoughts here...

 
 
 

RECENT POSTS

Boost

 
Blogger Widgets