On 27 Apr 2011, at 1:40 PM, Kevin Muldoon wrote:

>       NSString *aliasDirectory                =               
> [[NSHomeDirectory() stringByAppendingPathComponent: @"Desktop"] 
> stringByExpandingTildeInPath];
>       NSString *aliasName                     =               
> @"ANewAliasTo_myFile.png";
>       NSString *aliasPath                     =               [aliasDirectory 
> stringByAppendingPathComponent: aliasName];
>       
>       if( [[NDAlias aliasWithPath:filePath fromPath:aliasDirectory]  
> writeToFile:aliasName] ) {
>               NSLog(@"Create an alias for...\n\t %@", filePath);
>               NSLog(@"And placed the alias here...\n\t %@", aliasPath);
>       } else {
>               NSLog(@"Alias file creation failed");
>       }

Compare 

        [[NDAlias aliasWithPath:filePath fromPath:aliasDirectory]  writeToFile: 
alias>>>Name<<<]

to

        NSLog(@"And placed the alias here...\n\t %@", alias>>>Path<<<);


Also — though probably you're just doing it for the example — I don't recommend 
finding standard directories by concatenating literal strings. Pass the 
constant NSDesktopDirectory to NSSearchPathForDirectoriesInDomains().

        — F

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to