• 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: createDirectoryAtPath problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: createDirectoryAtPath problems


  • Subject: Re: createDirectoryAtPath problems
  • From: Josh Aas <email@hidden>
  • Date: Wed, 5 Feb 2003 00:04:20 -0600

There's a lot of weird stuff going on in your code... I'm not sure what the point of most of it is so maybe I'm not reading right. That said, here is how I'd rewrite what you wrote (I didn't look up the method return values so I'll assume you did).

NSString *directoryLocation = [@"~/Library/Application Support/DevKit" stringByExpandingTildeInPath];
NSFileManager *man = [NSFileManager defaultManager];
[man createDirectoryAtPath:directoryLocation attributes:nil] ? NSLog(@"It worked!") : NSLog(@"It didn't work!");

But to the point, the reason you're getting null is that "%@" means you're substituting an NSString. You're trying to substitute a boolean value there. The string you're substituting would be null 'cause its not a string.

-Josh Aas

On Tuesday, February 4, 2003, at 09:09 PM, Mathew Peterson wrote:

Hi,

I am trying to create a directory in ~/Library/Application Support
called DevKit.

Here is what I have done:

bool i;
NSString *directoryLocation = [[NSString alloc]
initWithFormat:@"~/Library/Application Support/DevKit/"];
[directoryLocation stringByExpandingTildeInPath];
NSFileManager *man = [NSFileManager defaultManager];
i =
NSLog(@"%@", i);

It keeps returning (null). What am i doing wrong?

Mat
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >createDirectoryAtPath problems (From: Mathew Peterson <email@hidden>)

  • Prev by Date: Re: Disadvantages of Bridging Java in Objective-C Cocoa Apps
  • Next by Date: Re: createDirectoryAtPath problems
  • Previous by thread: createDirectoryAtPath problems
  • Next by thread: Re: createDirectoryAtPath problems
  • Index(es):
    • Date
    • Thread