Hi guys, im learning Objective-C with XCode.
Im tying to get the User full path directory, im getting "good" return, but without the user full path (/User/Asinox), just im getting NSPathStore2.
I was trying with NSHomeDirectoryForUser() and with StringByExpandingTildeInPath and the result was the same (NSPathStore2).
Im using XCode 3.2.3 and SDK 4.0.1 on MAC OS X 10.6.4
#import <Foundation/Foundation.h>
void PrintPathInfo(){
//NSString *path = @"~";
NSString *directory = NSHomeDirectoryForUser(@"asinox");//[path stringByExpandingTildeInPath];
NSArray *pathComponents = [directory pathComponents];
NSLog(@"My home folder is at %@", *directory);
NSLog(@"===============================");
for(NSString *ruta in pathComponents){
NSLog(@"%@", ruta);
}
NSLog(@"===============================");
}
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
PrintPathInfo();
[pool release];
return 0;
}