Anyone have any idea why this code causes a SIGBUS 10 error?
Surely I should be able to add a category to NSString? My Objective-C book instructs me to do so!
Code:
@inferface NSString (TempFiles)
+(NSString *) temporaryFileName;
@end
@implementation NSString (TempFiles)
+(NSString *) temporaryFileName
{
NSProcessInfo *proc = [NSProcessInfo processInfo];
NSString *tempdir = NSTemporaryDirectory();
return [tempdir stringByAppendingPathComponent: [proc globallyUniqueString]];
}
@end
Surely I should be able to add a category to NSString? My Objective-C book instructs me to do so!