• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Files can't be saved to the relative paths?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Files can't be saved to the relative paths?
      • From: Henry McGilton <email@hidden>
    • Re: Files can't be saved to the relative paths?
      • From: Uli Kusterer <email@hidden>
    • Re: Files can't be saved to the relative paths?
      • From: Andrew Merenbach <email@hidden>
  • Prev by Date: Re: Problem with NSMutableDictionary
  • Next by Date: Re: Files can't be saved to the relative paths?
  • Previous by thread: Re: Problem with NSMutableDictionary
  • Next by thread: Re: Files can't be saved to the relative paths?
  • Index(es):
    • Date
    • Thread