CATransition undefined?

Discussion in 'iOS Programming' started by big_malk, Mar 12, 2011.

  1. big_malk macrumors 6502a

    Joined:
    Aug 7, 2005
    Location:
    Scotland
    #1
    Hi, I'm working through the guides and sample code on Apple's site to learn iOS development, I think I'm getting the hang of the basics but this one has me stumped.

    I'm trying to do a simple transition between two images, I've built the sample project fine, and I've copied the code into my own project with other stuff, but I'm getting the error 'CATransition undefined' when I try to build. I'm assuming this is because I haven't included a framework properly. I have
    #import <QuartzCore/QuartzCore.h>, which is the only reference I can find in the sample project to import any frameworks.

    I noticed that I didn't have 'QuartCore.framework' in the frameworks directory of my project, but it is there in the sample project. I tried to find a 'proper' way to include it, but failed (the guides/forum help on google are all pre xcode4, I don't know if this has changed but I just couldn't follow those guides). So I dragged it across from the sample one, but it made no difference. Is there a proper way to add that framework to the project, or am I just totally wrong about that being the problem?

    Cheers!
     
  2. dantastic macrumors 6502

    dantastic

    Joined:
    Jan 21, 2011
    #2
    In Xcode right click the folder 'Frameworks' > 'Add' > 'Existing Frameworks...' select 'QuartzCore.framework' hit 'Add'
     
  3. big_malk thread starter macrumors 6502a

    Joined:
    Aug 7, 2005
    Location:
    Scotland
    #3
    Thanks, but that didn't work for me, there was no 'Add' option there. I did find it though, I selected my application app in the project navigator, selected my app in the list of targets, selected build phases, expanded 'Link binaries with Libraries' and clicked add there. Not the most obvious place!

    I am pretty suck with another problem though - I just cannot get images to show in a UIImageView :confused:

    I'm trying two different ways (and every variation of these I can think of):
    Code:
    UIImage *image1 = [UIImage imageNamed:@"image1.jpg"];
    view1 = [[UIImageView alloc] initWithImage:image1];
        
    UIImage *image2 = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"image2" ofType:@"jpg"]];
    view2 = [[UIImageView alloc] initWithImage:image2];
        
    view2.hidden = YES;
    [containerView addSubview:view1];
    [containerView addSubview:view2];
    There's no errors, and the animation they're supposed to be used in is working fine, but just with the empty background color of containerView. The images are definitely in the project navigator (not just the dir n finder), but I just can't get them to show :confused:
     

Share This Page