Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

tranvutuan

macrumors member
Original poster
Dec 19, 2011
74
0
Hi everyone
Given a folder name and it is in our project folder,are there any ways to get a full path of it.
 
Look into this...

Code:
+ (NSString *) appRootPathString
{
	NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
	NSString * documentsDirectory = [paths objectAtIndex: 0];
	return documentsDirectory;
}


Look into the NSFileManager class...

Code:
[[NSFileManager defaultManager] fileExistsAtPath: projectFolder]
The variable projectFolder is an ivar in my class that I've already set in other code.

Oh, and look at the 'Working with Paths' section of the NSString class.
 
Last edited:
Look into this...

Code:
+ (NSString *) appRootPathString
{
	NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
	NSString * documentsDirectory = [paths objectAtIndex: 0];
	return documentsDirectory;
}


Look into the NSFileManager class...

Code:
[[NSFileManager defaultManager] fileExistsAtPath: projectFolder]
The variable projectFolder is an ivar in my class that I've already set in other code.

Oh, and look at the 'Working with Paths' section of the NSString class.

I really appreciate your help..Thanks
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.