Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 06-25-2009, 08: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
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 23,986
Threads: 38,771
Posts: 170,119
Top Poster: smasher (2,560)
Welcome to our newest member, r13mus
Powered by vBadvanced CMPS v3.1.0

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