Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

big_malk

macrumors 6502a
Original poster
Aug 7, 2005
557
1
Scotland
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!
 
In Xcode right click the folder 'Frameworks' > 'Add' > 'Existing Frameworks...' select 'QuartzCore.framework' hit 'Add'
 
In Xcode right click the folder 'Frameworks' > 'Add' > 'Existing Frameworks...' select 'QuartzCore.framework' hit 'Add'

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:
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.