2011-08-24 3 views
0

이미지 수신, 디코딩 및 문서 파일 저장을 시도했지만 다른 버전의 iPhone에 대한 Uikit 제한을 수정 한 후 Core Services 라이브러리 및 Uikit과의 호환성 문제가있었습니다. . 나는 다른 문제가 :gcc-4.2가 종료 코드 1로 인해 실패했습니다. iphone

GCC-4.2 종료 코드 1 오류 줄에 마우스 오른쪽 버튼을 클릭 한 후 아이폰

하고 "성적 증명서 텍스트 파일 등이 최신 결과를 열고"실패했습니다

Build WSStub of project WSStub with configuration Debug 

Ld build/Debug/WSStub normal i386 
cd /Users/********/Desktop/WSStub 
setenv MACOSX_DEPLOYMENT_TARGET 10.5 
/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -L/Users/********/Desktop/WSStub/build/Debug -F/Users/********/Desktop/WSStub/build/Debug -F/Users/********/Desktop/WSStub -filelist /Users/********/Desktop/WSStub/build/WSStub.build/Debug/WSStub.build/Objects-normal/i386/WSStub.LinkFileList -mmacosx-version-min=10.5 -framework Foundation -framework CoreServices -framework UIKit -framework CoreGraphics -o /Users/********/Desktop/WSStub/build/Debug/WSStub 

ld: warning: in /Users/********/Desktop/WSStub/UIKit.framework/UIKit, missing required architecture i386 in file 
ld: warning: in /Users/********/Desktop/WSStub/CoreGraphics.framework/CoreGraphics, missing required architecture i386 in file 
ld: duplicate symbol _UIEdgeInsetsMake in /Users/********/Desktop/WSStub/build/WSStub.build/Debug/WSStub.build/Objects-normal/i386/main.o and /Users/********/Desktop/WSStub/build/WSStub.build/Debug/WSStub.build/Objects-normal/i386/EnvioImagen.o 
collect2: ld returned 1 exit status 
Command /Developer/usr/bin/gcc-4.2 failed with exit code 1 

나는

main.m .....이 문제를 해결 할수 없어

... 

Envio * envio = [[Envio alloc] init]; 


[envio setMethod:method]; 
NSDictionary * imagen = [[NSDictionary alloc] initWithDictionary:[envio resultValue]]; 
NSString *im = [[NSString alloc] initWithString: [imagen valueForKey:@"return"]]; 
NSData * imagenDecode = [envio base64DataFromString:im]; 
[envio save:imagenDecode]; 

... 
,

EnvioImagen.m

#import "EnvioImagen.h" 

@implementation Envio 


- (void) setMethod:(NSString*)myMethod 
{...} 

- (void) setInvocation:(NSString*)invoc 
{...} 

- (void) setSoap:(NSString*)mySoap 
{...} 

- (void) setNameSpace:(NSString*)myNamespace 
{...} 


- (NSDictionary*) resultValue 
{...} 

- (WSMethodInvocationRef) genCreateInvocationRef 
{...} 


+ (NSData *)base64DataFromString: (NSString *)string 
{.....} 

+ (void)save: (NSData *)data 
{ 

    UIImage *im = [[UIImage alloc]initWithData:data]; 
    NSData *datai = UIImagePNGRepresentation(im); 

    NSFileManager *fileManager = [NSFileManager defaultManager]; 
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory,  NSUserDomainMask, YES); 
    NSString *directory = [paths objectAtIndex:0]; 
    NSString *fullPath = [directory stringByAppendingPathComponent:@"david.png"]; 
    [fileManager createFileAtPath:fullPath contents:datai attributes:nil]; 

} 

@end; 

@implementation EnvioImagen 

+ (id) Envio:(CFTypeRef) parameters 
{ 
    id result = NULL; 

    Envio* invocation = [[Envio alloc] init]; 

    result = [[invocation resultValue] retain]; 

    [invocation release];  

    return result;  
} 

@end 

답변

0

당신은 맥 OS X SDK를하지 아이폰 SDK 중 하나에 SDK를 설정했습니다. Mac OS X에는 UIKit이 없습니다.

+0

좋아, 어떻게 아이폰 SDK를 선택할 수 있습니까? – David

+0

@David : 솔직히 말해서, 나는 잘 모르겠다. SDK에 대한 빌드 설정이 있습니다. 그것을 바꾸는 것으로 충분할 수도 있습니다. – JeremyP

0

당신이 아키텍처에 뭔가 망쳐 놓은 것처럼 보입니다. 따라서 컴파일러는 iOS 대신 Mac OS 용으로 컴파일한다고 생각합니다. 빌드 설정을 확인하거나 스키마를 다시 생성하십시오 (제품 -> 스키마 관리 -> 자동 생성).

관련 문제