我正在尝试拆分字符串并将其分成变量,但出现以下错误:
* 由于未捕获的异常“NSRangeException”而终止应用程序,原因:“* -[__NSArrayM objectAtIndex:]: index 2 beyond bounds [0 .. 1]”
代码:
NSLog(@"%@", strResult);
NSArray* LocInfo = [strResult componentsSeparatedByString: @"|"];
NSString* Response1 = [LocInfo objectAtIndex: 0];
NSString* Response2 = [LocInfo objectAtIndex: 1];
NSString* Response3 = [LocInfo objectAtIndex: 2];
有任何想法吗?谢谢!