[NSNumber parseString:(NSString *)contentLength intoUInt64:&requestContentLength]
parseString is a category which had been added to the NSNumber class and was defined in a header file correctly like so...
+ (BOOL)parseString:(NSString *)str intoUInt64:(UInt64 *)pNum
{
if(str == nil)
{
*pNum = 0;
return NO;
}
errno = 0;
// On both 32-bit and 64-bit machines, unsigned long long = 64 bit
*pNum = strtoull([str UTF8String], NULL, 10);
if(errno != 0)
return NO;
else
return YES;
}
Now all worked fine if i used this directly in my application however when this code was part of a linked static library the code would fail with the error message.
After a little surfing i found that you need to add -all_load into the liker options for the main application.
According to the post below -ObjC should also work in XCode4 but I have not been able to get this to work only -all_load
http://stackoverflow.com/questions/932856/calling-method-on-category-included-from-iphone-static-library-causes-nsinvalidar