开发者

Issue posting variable with iPhone SDK

开发者 https://www.devze.com 2023-01-22 14:19 出处:网络
I am encountering an issue while posting a variable with Xcode: While running this code the app crashes while posting the variable to a webservice:

I am encountering an issue while posting a variable with Xcode:

While running this code the app crashes while posting the variable to a webservice:

NSArray *array = [stringFromFile componentsSeparatedByString: @","];
NSString *time = [array objectAtIndex:1];
UTCorLocal = time;
NSLog(@"%@", UTCorLocal);

UTCorLocal variable is declared earlier in the code. The NSLog outputs the correct string, but when I try to use it further along in the code it crashes.

When I give the variable a static value like this:

UTCorLocal = @"UTC";

It all runs like it should do!

Could anybody please help, it's driving me crazy!

Thanks开发者_运维问答 a lot,

Ron


It's probably released somewhere along the way, I would guess, without knowing the rest of your code. Try copying or retaining 'time' and see what happens.

0

精彩评论

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