On 23/04/2009, at 10:19 , Miles wrote:
I have a timer that continues calling a method that for the moment (testing
purposes) only contains:
NSArray *tmp = [NSArray arrayWithArray:animatingTilesArray];

The time is setup like this:
animationTimer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self
selector:@selector(doAnimation:) userInfo:nil repeats:YES];

When I run this in ObjectAlloc, it shows that every instance of the 'tmp'
array created above is 'created and still living'. Considering it's an
auto-released array shouldn't there only be zero or one still living?

If you are only running a timer, you may be running in to the issue described at:

<http://www.cocoabuilder.com/archive/message/cocoa/2008/12/16/225553>

The run loop autorelease pool is not released for timer events.

If so, you should see all your objects disappear as soon as you do a UI action in your app, like click the mouse.

You have two possible solutions:

* Periodically post an event to your app.
* Create and release an NSAutoreleasePool in your timer method.

Enjoy,
   Peter.


--
     Run macros from your iPhone with Keyboard Maestro Control!
         or take a break with Derzle for your iPhone

Keyboard Maestro <http://www.keyboardmaestro.com/> Macros for your Mac
Aragom Space War <http://www.stairways.com/iphone/aragom> Don't get killed!
Derzle <http://www.stairways.com/iphone/derzle> Enjoy a relaxing puzzle.
<http://www.stairways.com/>           <http://download.stairways.com/>




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to