Category class method problem
Category class method problem
- Subject: Category class method problem
- From: Kaspar Fischer <email@hidden>
- Date: Thu, 9 Mar 2006 20:26:55 +0100
Hi,
What is the problem with the following code? It must be
something simple, because it results in a bus error at (*)
-- but I ust don't see it!
@implementation NSString (KFStringUtilities)
+ (NSString *)nameOfTemporaryFileWithExtension:(NSString *)extension
{
static int sequenceNumber = 0;
NSString *tmpDir = NSTemporaryDirectory();
if (tmpDir == nil)
tmpDir = @"/tmp/";
NSString *name;
do {
sequenceNumber++;
name = [NSString stringWithFormat:@"%@/%d-%d.%@", // (*)
[[NSProcessInfo processInfo] processIdentifier],
(int)[NSDate timeIntervalSinceReferenceDate],
sequenceNumber,
extension];
} while ([[NSFileManager defaultManager] fileExistsAtPath:name]);
return name;
}
@end
Thanks,
Kaspar
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden