• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [SOLVED] createDirectoryAtPath anomaly between system versions?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: [SOLVED] createDirectoryAtPath anomaly between system versions?
      • From: Antonio Nunes <email@hidden>
References: 
 >createDirectoryAtPath anomaly between system versions? (From: Antonio Nunes <email@hidden>)
 >Re: [SOLVED] createDirectoryAtPath anomaly between system versions? (From: Antonio Nunes <email@hidden>)

  • Prev by Date: Core Data document-based apps saves empty files
  • Next by Date: Newbie Q : writing into a text view programmatically
  • Previous by thread: Re: [SOLVED] createDirectoryAtPath anomaly between system versions?
  • Next by thread: Re: [SOLVED] createDirectoryAtPath anomaly between system versions?
  • Index(es):
    • Date
    • Thread