Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 12-24-2009, 10:37 AM   #17 (permalink)
eddietr
Registered Member
 
Join Date: Apr 2009
Posts: 536
eddietr is on a distinguished road
Default

Quote:
Originally Posted by Johanovski View Post
Code:
UIImage* img = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"sangnormal01" ofType:@"png"]];
texMoscaNormal[0][0] = [[Image alloc] initWithImage:img];
[img release];  // <-- You don't want this
I haven't read the whole thread, but just commenting on this last post...

+[UIImage imageWithContentsOfFile] will return a UIImage that has been autoreleased.

So you don't want to release it again.

And then of course you want to make sure that -[Image initWithImage:] is retaining the UIImage and releasing it in -[Image dealloc].

Hope that helps.
eddietr is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,421
Threads: 94,016
Posts: 402,538
Top Poster: BrianSlick (7,978)
Welcome to our newest member, maryleeag34
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:44 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.