Lets consider the following scenario:
I have a class , where I have a member variable named "sampleArray". I have only one Autorelease pool as part of my App.(main.m).
I add some objects to "sampleArray" using a convenience constructor in a method named "Method1".
Based on autorelease concept(NSAutoreleasePool), the object would be no...
Hi Friends,
under the "Guaranteeing the Foundation Ownership Policy" in Apple developer's site article on Autorelease pool
http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmAutoreleasePools.html#//apple_ref/doc/uid/20000047-997594, they talk about extending an object's lifetime beyond the Autor...
Is there a way to know the objects that are marked for releasing inside an NSAutoreleasePool.
...
Hi there!
I'm developing an iphone app and when I turn on my NSZombieEnabled I have regularly a crash on error :
*** -[CALayer retain]: message sent to deallocated instance 0xe6012e0
It always come when I push or pop a view in my view controller. Sometimes there's this error before :
-[UIApplication endIgnoringInteractionEvents] cal...
Hi all,
I have a small iPhone app which has a button on the first view. When I select this button I load up my new view which has an image on it. I'm currently using the following code to load the image from an online source on a separate thread, whilst allowing the user to continue controlling the application:
- (void) loadImageTest
{...
I am getting an EXC_BAD_ACCESS error after I return from a thread method in which I have set up an NSAutoreleasePool. The place of failure is at a call to NSRunLoop. I am trying to wrap a 3rd party library consisting mainly of a class (let's call it the Connection class) and its delegate such that it will behave synchronously instead o...
Is there any way to query the number of objects that reside in a given NSAutoreleasePool?
This is really important for me, because in my game there are several loops and I need to know how effectively I'm autoreleasing my autoreleased objects.
...
I drained an autorelease pool. The warning *** attempt to pop an unknown autorelease pool means the autorelease pool was created and drained in different methods - that's fine.
But does it mean such pool is NOT being drained?
Is there a solution?
...
I came across a problem that seems to be called "drowning" in autorelease pools.
My code creates and destroys objects correctly. However, I use some class methods that autorelease several variables without my knowing about it. Considering they loop thousands and thousands of times every minute... I find myself drowning in thousands of u...
I'm working up a graphics effect for an iPhone app that simulates a low-res plasma effect from old demoscene days. I've got 600 squares on screen that are updating as fast as possible. Since I am using CoreGraphics (for now), I can get a very constant 11FPS with no freezing--
BUT when I try to add one simple NSArray lookup, the iPhone a...
I have two problems
1) My App works fine on the device the first few times its run. Then it crashes after the First screen pops up(Tab BAr). If i connect the device to my MAC and then run the device app it works(not debug mode).
I Checked the crash Logs, it crashed cos of "EXC_BAD_ACCESS (SIGSEGV)" and Thread0 crashed.The error was N...
I have some NSOperations subclasses that handle CoreData imports. I believe i've ticked most of the non-main thread issues
I create my own autorelease pool in the
main method
I create a NSManagedObjectContext for each
operation
These operations are loaded into a NSOperationQueue, with the maximum number of concurrent operations set 1...
I have two related questions concerning NSAutoreleasePool.
Between declaring the pool and draining it, can I use animation? Example
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
subView.alpha = 0.10;
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[UIView setAnimationDelegate:self];
[UIView ...
What is the best way to write a thread safe method?
I have the following method, sometimes i want to call it asynchronously (call it through a thread)
And sometimes i want to call it directly on the main thread.
Is there a problem with keeping the pool (alloc, release) even if I am not calling the method on a separate thread?
- (void)d...