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

Chirone

macrumors 6502
Original poster
Mar 2, 2009
279
0
NZ
ok this time i won't find the answer straight after i post...

in my program i have a whole heap of drawing code in the -(void)drawView method
it draws fine when running it on 3.0 and 3.1
but as soon as i switch back to 2.2.1 nothing appears

i put break points in the drawView method and it never stopped at them
so it's not even calling the method

i tried calling the -(void)layoutSubviews from the initWithCoder that is just the
Code:
- (void)layoutSubviews {
    [EAGLContext setCurrentContext:context];
    [self destroyFramebuffer];
    [self createFramebuffer];
    [self drawView];
}
code

which is what was there when i first made the project and it worked fine with 2.2.1, and it goes through all the methods without problem but it still doesn't draw anything..

what makes it draw in 3.0 and not in 2.2.1?
 
did you use the framework for the 3.0 OS, as that OpenGL ES is 2.0 and not 1.1 like the other OS for the iphone have.
 
nope
it would have given compile errors if i was using openGLES 2

the project used to from the template that worked with iphone 2.2.1

i didn't actually notice when it stopped working until now when the app is almost complete...
 
app delegate is calling it correctly?
the init method being called correctly?
i would put print statements step by step and then you will find exactly where the problem is
 
hmmm

ok, so i took a wild shot and looked back at the MainView's initWithNibName

in there is the code:

Code:
PageViewController* pageView = [[PageViewController alloc] initWithNibName: @"PageView" bundle:nil];
		[self.view addSubview: pageView.view];
		[pageView release];
in 3.0 this works fine

in 2.2.1 if i take out the [pageView release] line it works... all the interactions and stuff work as well

i thought I had to release it because that's what I read in the docs somewhere

is this going to cause problems on the ones apps built for 3.0?

if i don't release it in the initWithNib method then when should I release it?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.