Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 02-17-2010, 08:32 PM   #42 (permalink)
intomo
Registered Member
 
Join Date: Jul 2009
Posts: 62
intomo is on a distinguished road
Default nevermind

Code:
- (NSString *)dataFilePath:(NSString *)file
{
	NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
	NSString *documentsDirectory = [paths objectAtIndex:0];
	return [documentsDirectory stringByAppendingPathComponent:file];
}
I needed to modify that so that I could pass in parameters. The code didn't know where the photo file was.

Code:
-(IBAction)createZip:(id)sender
{
	
	NSLog(@"Entering %s", __FUNCTION__);
	
	NSString *filePath = [self dataFilePath:l_zipfile];
	
	ZipArchive *currentZip = [[ZipArchive alloc] init];
	BOOL ret = [currentZip CreateZipFile2:filePath];
	
	
	
	ret = [currentZip addFileToZip:[self dataFilePath:l_photo];" newname:@"jack.png"];
	if( ![currentZip CloseZipFile2] )
	{
		NSLog(@"Zip Error");
	}
	[currentZip release];
}
Thanks again!
intomo is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,486
Threads: 94,041
Posts: 402,629
Top Poster: BrianSlick (7,978)
Welcome to our newest member, hughricotta
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:06 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.