Re: NSString / NSURL
Re: NSString / NSURL
- Subject: Re: NSString / NSURL
- From: Dave DeLong <email@hidden>
- Date: Sat, 28 Aug 2010 09:03:11 -0600
This is incorrect:
> NSString* fileName= [filePath lastPathComponent];
> NSMutableString* imagePath;
> imagePath = defaultImageLocation;
>
> [imagePath stringByAppendingPathComponent:fileName];
>
> [[ NSFileManager defaultManager ] copyItemAtPath:filePath toPath:imagePath error:nil];
> [Product setValue:imagePath forKey:@"productImage"];
Just because you declare a pointer to an NSMutableString does not mean you actually have an NSMutableString. In this case, you have an NSString (since defaultImageLocation is a immutable string). Also, you're ignoring the return value of stringByAppendingPathComponent:, so after that method invocation, imagePath is still equivalent to defaultImageLocation.
I'm guessing that it's failing because you're trying to copy a file (at filePath) to the location of a directory (imagePath).
Dave
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden