I’m a total newbie at Objective-C, so bear with me. This is how I’m concatenating my URL:
id url = [NSURL URLWithString:@"http://blahblah.com/gradient.jpg"];
id image = [[NSImage alloc] initWithContentsOfURL:url];
id tiff = [image TIFFRepresentation];
NSString *docsDir = [NSHomeDirectory() stringByAppendingPathComponent: @"Desktop"];
NSString *fileToWrite = @"/test.tiff";
NSString *fullPath = [docsDir stringByAppendingString:fileToWrite];
[tiff writeToFile:fullPath atomically:YES];
It works, but it seems sloppy. Is this the ideal way of doing concatenating NSStrings?
stringByAppendingString:orstringWithFormat:pretty much is the way.