Re: [SOLVED] createDirectoryAtPath anomaly between system versions?
Re: [SOLVED] createDirectoryAtPath anomaly between system versions?
- Subject: Re: [SOLVED] createDirectoryAtPath anomaly between system versions?
- From: Nir Soffer <email@hidden>
- Date: Fri, 7 Jul 2006 15:28:03 +0300
On 07/07/2006, at 13:35, Antonio Nunes wrote:
@implementation ANAppController
- (void)applicationWillFinishLaunching:(NSNotification *)aNotification
{
BOOL isDir, exists = NO, success = NO;
isDir is now some random value
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *myAppDirectoryPath = nil;
NSArray *paths = NSSearchPathForDirectoriesInDomains
(NSApplicationSupportDirectory, NSLocalDomainMask, YES);
if ([paths count] > 0) {
myAppDirectoryPath = [[paths objectAtIndex:0]
stringByAppendingPathComponent:@"MySupportFolderTestApp"];
exists = [fileManager fileExistsAtPath:myAppDirectoryPath
isDirectory:&isDir];
if (!isDir) {
Since isDir is random value, your code will randomly works :-)
success = [fileManager createDirectoryAtPath:myAppDirectoryPath
attributes:nil];
if (!success) {
[...]
}
} // if (!isDir)
} else {
[...]
} // if ([paths count] > 0)
}
@end
Best Regards,
Nir Soffer
_______________________________________________
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