I am confused by the Apple documentation for low-level file handling:
http://tinyurl.com/q5bzo3
For the example:
I just want the home directory, and not appending anything to it.
I tried
but Xcode gives an error of expecting : before ] and so I take it is expecting some parameter to be passed.
I tried passing an empty string literal @"", and it worked, but surely that is not the right way to do it (?)
Clicking on the hyperlink for NSHomeDirectory gives a fairly useless description:
NSHomeDirectory
Returns the path to the current users home directory.
NSString * NSHomeDirectory (void);
Return Value
The path to the current users home directory.
Discussion
For more information on file-system utilities, see Low-Level File Management Programming Topics.
Availability
* Available in Mac OS X v10.0 and later.
See Also
* NSFullUserName
* NSUserName
* NSHomeDirectoryForUser
Related Sample Code
* Quartz Composer WWDC 2005 TextEdit
Declared In
NSPathUtilities.h
Please advise where I should be looking, because I have tried searching in all the usual places (including option+double clicking) and the docs are not helpful.
Thanks!
http://tinyurl.com/q5bzo3
For the example:
Code:
NSString *path = [NSHomeDirectory() stringByAppendingPathComponent:@"MyFile.txt"];
I just want the home directory, and not appending anything to it.
I tried
Code:
NSString *path = [NSHomeDirectory()];
but Xcode gives an error of expecting : before ] and so I take it is expecting some parameter to be passed.
I tried passing an empty string literal @"", and it worked, but surely that is not the right way to do it (?)
Clicking on the hyperlink for NSHomeDirectory gives a fairly useless description:
NSHomeDirectory
Returns the path to the current users home directory.
NSString * NSHomeDirectory (void);
Return Value
The path to the current users home directory.
Discussion
For more information on file-system utilities, see Low-Level File Management Programming Topics.
Availability
* Available in Mac OS X v10.0 and later.
See Also
* NSFullUserName
* NSUserName
* NSHomeDirectoryForUser
Related Sample Code
* Quartz Composer WWDC 2005 TextEdit
Declared In
NSPathUtilities.h
Please advise where I should be looking, because I have tried searching in all the usual places (including option+double clicking) and the docs are not helpful.
Thanks!