Question

I´ve tryed to receive a image, decode and save in Documents file but i had some problem of compatibility with Core Services library and Uikit, after modify Uikit restrictions of different version of Iphone. I have other problem:

gcc-4.2 failed with exit code 1 iphone

After right click in the error line and choose "Open These Latest Results as Transcript Text File":

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

I can´t solve this problem.....

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
Was it helpful?

Solution

You've set your SDK to one of the Mac OS X SDKs, not an iPhone SDK. Mac OS X doesn't have the UIKit.

OTHER TIPS

Seems like you messed something up with architectures. So compilers thinks it is compiling for Mac OS instead of iOS. Check your build settings and/or regenerate schemes(Product->Manage Schemes->Autogenerate).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top