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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 06-25-2009, 09:09 AM   #1 (permalink)
xash
New Member
 
Join Date: Jun 2009
Posts: 5
Question Need help with memory management

hey guys!

i have got the following problem: with a timer i call the function draw repeatly (in the timer runLoop function) and found out, that the following commands will increase the memory usage permanently:

Code:
NSNumber *n = [NSNumber numberWithFloat:self.number];
shouldn't this be autoreleased?

Code:
NSString *num = [formatter stringFromNumber:n]];
here formatter is a NSNumberFormatter, initialized in init

Code:
self.drawView.frame = CGRectMake(self.x, self.y, self.width, self.height);
a CGRect is only a structure, right? why is this allocating memory constantly?

i also tried to add a NSAutoReleasePool to the timer function, but that is also not working. furthermore, i tried to alloc the NSString and release it again at the end of the function, but that didn't help.



thanks in advice
xash
xash is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,686
Threads: 89,159
Posts: 380,403
Top Poster: BrianSlick (7,110)
Welcome to our newest member, v2w
Powered by vBadvanced CMPS v3.1.0

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