2010-11-09 62 views
0

我必须缺少一些东西。我试图修剪从数组中拉出的数据,但是我的应用程序崩溃了修剪方法。Objective-C:修整空白

   //pull values 
NSString* thisXStr = [thisSetArray objectAtIndex:0]; 
NSString* thisYStr = [thisSetArray objectAtIndex:1]; 

//cleaning up all the white space 
NSString *thisXStrTrim = [thisXStr stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]]; 
NSString *thisYStrTrim = [thisYStr stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]]; 
+0

错误说的是什么? – kennytm 2010-11-09 14:42:13

回答

1

尽量使数组对象的副本: 的NSString * thisXStr = [NSString的stringWithString:[thisSetArray objectAtIndex:0] ]。 ...

0

废话,没关系的,愚蠢的语法错误上的NSLog ...