Files can't be saved to the relative paths?
Files can't be saved to the relative paths?
- Subject: Files can't be saved to the relative paths?
- From: Steve <email@hidden>
- Date: Sun, 19 Aug 2007 10:51:58 +0000
Hi Everyone.
What I want to do is capture some pictures of the movie, then save
them to the current desktop. Then I use the code following:
NSImage * currentFrameImage = [movie currentFrameImage];
// get current frame presented by NSImage
NSData * tiffData = [currentFrameImage TIFFRepresentation];
//get the tiff Data from the NSImage
NSCalendarDate * newCalendarDate = [NSCalendarDate calendarDate];
[newCalendarDate setCalendarFormat:@"%Y%m%d%H%M%S"];
NSString * fileName = [NSString stringWithFormat:@"%@-%@.tiff",
[[globalPath lastPathComponent] stringByDeletingPathExtension],
[newCalendarDate description]];
//NSLog(fileName);
//The following path is the issue.
NSString * folderPath = @"/";
//
NSString * resultString = [folderPath
stringByAppendingPathComponent:fileName];
NSLog(resultString);
if ([tiffData writeToFile:resultString atomically:YES] ) {
printf("Image Saved\n");
}
I used the folderPath variable to present the path. However , if I wrote
code like these: folderPath = @"$HOME/Desktop", the tiffDate
writeToFile function never works. I don't know why, perhaps you have
to write to absolute path?
Thank you for any reply.
Cheers.
_______________________________________________
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