문제

I have to be missing something. I'm trying to trim the data being pulled from an array but my app crashes on the trim method.

                //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]];
도움이 되었습니까?

해결책

Try to make a copy of the array objects: NSString *thisXStr = [NSString stringWithString:[thisSetArray objectAtIndex:0]]; ...

다른 팁

Crap, never mind, stupid syntax error on a NSLog...

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top