NSString *unexpandedPath = [[NSString alloc] initWithString:@"~/Library/YoutFolder/YourImage.png"]; NSString *imagePath = [NSString pathWithComponents:[NSArray arrayWithObjects:[NSString stringWithString:[unexpandedPath stringByExpandingTildeInPath]], nil]];
A collection of example source codes for c/c++ and ios and android platform. It also includes objective c.
Saturday, May 14, 2011
NSString pathWithComponents example
[NSString:pathWithComponents example] Following code fragment shows how to use NSString:pathWithComponents method. It's very useful if you want to create a path name dynamically in your program by changing an existing path. [NSString:pathWithComponents example]