Objective-C and Cocoa : crash when calling a class function without entering the function

Posted by Oliver on Stack Overflow See other posts from Stack Overflow or by Oliver
Published on 2011-01-02T23:46:58Z Indexed on 2011/01/02 23:53 UTC
Read the original article Hit count: 211

Hello,

I have a class function (declared and implemented) in a class MyUtils :

+ (NSString*) theFunction:(NSString*)param1 param2:(NSString*)param2 param3:(NSString*)param3;

When I call this function, with :

NSString *item = [MyUtils theFunction:@"abc" param2:aPreviousNSString param3:@"xyz";

my app crashes. In the debugger I have a breakpoint on the first action of the "theFunction" function. And this breakpoint is never reached.

If I replace the call by NSString *item = @"youyou"; then everything is ok.

Forcing a retain on aPreviousNSString before the call does not change anything. Do you have an idea of what is happening ?

Thanks

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about crash