Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Darkroom

Guest
Original poster
Dec 15, 2006
2,445
0
Montréal, Canada
this isn't working right now, but i think i'm on the right path... maybe i just have something small missing from the method?

it's an IBAction method. user activates the actions, the NSView is suppose to convert into a TIFF and save itself to the desktop.

Code:
-(IBAction)saveViewToDesktop:(id)sender
	{
	[self lockFocus];
	NSBitmapImageRep *rep = [[NSBitmapImageRep alloc] initWithFocusedViewRect:[self bounds]];
	[self unlockFocus];
	NSData *data = [rep TIFFRepresentation];
	NSString *filePath = @"/Users/[I]myrealname[/I]/Desktop/";
	[data writeToFile:filePath atomically:YES];
	}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.