레이블이 objectc인 게시물을 표시합니다. 모든 게시물 표시
레이블이 objectc인 게시물을 표시합니다. 모든 게시물 표시

2010년 4월 26일 월요일

objective-c 에서 Json framework 사용시 등록 실패 원인(invalid binary)

아이폰 어플등록을 하는데 아래와 같은 오류가 발생했다!
The binary you uploaded was invalid. The signature was invalid, or it was not signed with an Apple submission certificate

아~ 인증서 문제구나 하면서 인증서 관련 부분을 처음부터 다시 훑었는데...
  
objective-c 용 json 프레임웍이 원인 이었다.임베드 되어있는 파일들을 외부링크로 뺐을뿐인데

http://code.google.com/p/json-framework/wiki/InstallationInstructions#Option_2%3a_Use_the_iPhone_Custom_SDK

위 문서 아래 부분에
Option 2 needs to include a note about Distribution builds. My app submission was delayed by over a week due to the "invalid binary" error when uploading to iTunes Connect. After a few emails back and forth with Apple's engineering team, including sending them my Xcode project, they were able to isolate the source. I needed to include the following in the Code Signing Resource Rules Path:
$(SDKROOT)/ResourceRules.plist
If this information were included here, I could have saved a week of frustration. Thanks

$(SDKROOT)/ResourceRules.plist 이거만 Code Signing Resource Rules Path에 넣어주면
해결이 되었다...
자세히 보고 써야 하는데
설마 저런 이슈가 있을줄야 애꿎은 인증서랑 Xcode 만 못살게 굴었네 
누군가 도움이 되시길 

2010년 4월 12일 월요일

Mac objectC 이미지 저장 방법

command line Tool 로 이미지 캡쳐기 만들던 중
결론을 내려준 코드 ... 2박3일 삽질한 원인 두가지

1. __NSAutoreleaseNoPool(): Object 0x100306530 of class NSCFString autoreleased with no pool in place - just leaking
해결 : NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[pool release];
2. CGDataProviderRelease(dataProvider);

-
(void)saveJPEGImage:(CGImageRef)imageRef path:(NSString *)path {
CFMutableDictionaryRef mSaveMetaAndOpts = CFDictionaryCreateMutable(nil, 0,
&kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
CFDictionarySetValue(mSaveMetaAndOpts, kCGImageDestinationLossyCompressionQuality,
[NSNumber numberWithFloat:1.0]); // set the compression quality here
NSURL *outURL = [[NSURL alloc] initFileURLWithPath:path];
CGImageDestinationRef dr = CGImageDestinationCreateWithURL ((CFURLRef)outURL, (CFStringRef)@"public.jpeg" , 1, NULL);
CGImageDestinationAddImage(dr, imageRef, mSaveMetaAndOpts);
CGImageDestinationFinalize(dr);
}


-(void)savePNGImage:(CGImageRef)imageRef path:(NSString *)path {
NSURL *outURL = [[NSURL alloc] initFileURLWithPath:path];
CGImageDestinationRef dr = CGImageDestinationCreateWithURL ((CFURLRef)outURL, (CFStringRef)@"public.png" , 1, NULL);
CGImageDestinationAddImage(dr, imageRef, NULL);
CGImageDestinationFinalize(dr);
}

-(void)saveTIFFImage:(CGImageRef)imageRef path:(NSString *)path {
int compression = NSTIFFCompressionLZW; // non-lossy LZW compression
CFMutableDictionaryRef mSaveMetaAndOpts = CFDictionaryCreateMutable(nil, 0,
&kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
CFMutableDictionaryRef tiffProfsMut = CFDictionaryCreateMutable(nil, 0,
&kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
CFDictionarySetValue(tiffProfsMut, kCGImagePropertyTIFFCompression, CFNumberCreate(NULL, kCFNumberIntType, &compression));
CFDictionarySetValue(mSaveMetaAndOpts, kCGImagePropertyTIFFDictionary, tiffProfsMut);

NSURL *outURL = [[NSURL alloc] initFileURLWithPath:path];
CGImageDestinationRef dr = CGImageDestinationCreateWithURL ((CFURLRef)outURL, (CFStringRef)@"public.tiff" , 1, NULL);
CGImageDestinationAddImage(dr, imageRef, mSaveMetaAndOpts);
CGImageDestinationFinalize(dr);
}

2010년 4월 9일 금요일

[링크] objectc c++ 개발 가이드 문서

맥 공식 가이드 문서
http://developer.apple.com/Mac/library/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocCPlusPlus.html

pdf 문서
http://www.google.co.kr/url?sa=t&source=web&ct=res&cd=1&ved=0CBsQFjAA&url=http%3A%2F%2Fchachatelier.fr%2Fprogrammation%2Ffichiers%2Fcpp-objc-en.pdf&ei=D-q_S_-0IMyLkAW9ksW6BQ&usg=AFQjCNEDQG47H9HxuIJDSzfTPeiSYBmClQ&sig2=VbaELcK_OIHFBe8SNrN3hg

차이점 정리
http://yesarang.tistory.com/290