iOS에서 Document에 zip 파일을 넣어서 풀기


plist 에 UIFileSharingEnabled key를 추가 하고 YES로 설정 후 


앱을 실행하면 itunes application에서 파일 추가 가능. (아래 이미지는 이미 풀어진 스크린샷)


zip 압축 풀기는 아래 참조 

http://code.google.com/p/ziparchive/wiki/PageName

 

기존 문서에는 libz.1.2.3.dylib 넣으라고 나오는데 그냥 libz.dylib 넣으면 됨. 


끝. 



'iOS' 카테고리의 다른 글

JSONKit for iOS  (0) 2011.06.28
Objective-C Outlet  (0) 2010.08.07
UIView Flip 효과 - iPhone  (0) 2010.06.29
다운 받는 곳 
https://github.com/johnezang/JSONKit

사용법

#import "JSONKit.h"

... 


NSString *filePath = [[NSBundle mainBundle] pathForResource:@"items" ofType:@"json"];   

NSString *a = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];

    

// 클래스의 종류 내용보기 

//    NSLog(@"class:%@ a:%@",[a class], a);

    

// JSON NSArray NSDictionary 변환 

NSArray *array = [a objectFromJSONString];

NSLog(@"class: %@, %d", [array class], [array count]);

    

// Array에서 Dictionary 가져오기 

NSDictionary *dic = [array objectAtIndex:0];

NSLog(@"dic name:%@", [[dic valueForKey:@"name"] description]);

 

'iOS' 카테고리의 다른 글

iOS에서 Document에 zip 파일을 넣어서 풀기  (0) 2012.05.16
Objective-C Outlet  (0) 2010.08.07
UIView Flip 효과 - iPhone  (0) 2010.06.29

+ Recent posts