Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Can somebody fix this?

I want to use a path, but my name is in that path, so I want to change it but it gives a warning:

"Expression result unused"

I want to use this path:

NSString *paths = @"/Users/damianvandekauter/Documents/Pezani";

I change it to this path:

NSArray *PezaniPathFolder = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);

NSString *documentsDirectoryPezani = [PezaniPathFolder objectAtIndex:0];

NSString *paths = (documentsDirectoryPezani, @"/Pezani/Telenet.zip");


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


The last sentence says "Expression result unused".


________________________________________________________________________________ __________________________________


Xcode 6, objetive C, mac

Posted on Feb 28, 2015 1:39 AM

Reply
Question marked as Best reply

Posted on Feb 28, 2015 5:04 AM

The preferred format is to use NSFileManager and URLs, for example:


NSArray *directoryURLs = [[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask];
NSURL *pezaniURL = [[directoryURLs lastObject] URLByAppendingPathComponent:@"Pezani/Telenet.zip"];

NSString *pezaniPath = [pezaniURL path];
1 reply
Question marked as Best reply

Feb 28, 2015 5:04 AM in response to TikaSoftware

The preferred format is to use NSFileManager and URLs, for example:


NSArray *directoryURLs = [[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask];
NSURL *pezaniURL = [[directoryURLs lastObject] URLByAppendingPathComponent:@"Pezani/Telenet.zip"];

NSString *pezaniPath = [pezaniURL path];

Can somebody fix this?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.