According to another Stack Overflow post the drain message is an Apple-only call:
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSLog (@"Hello");
[pool drain];
return 0;
Is it safe to replace drain with release? I am trying to port an Objective-C application to run on Linux (Ubuntu at the moment). Should I give up even b...
I have a simple application that counts down to midnight and then plays a beeping sound over and over again and blinks the label showing the time. So the label blinking uses an NSTimer, while the beeping goes on its own Thread, so that the pure C function (for the system sound id completion callback) can use [NSThread sleepForTimeInterva...
I am using this line of code in iphone 2.0 its work fine
pool=[[NSAutoreleasePool alloc]init];
[pool release];
When i run this line of code in iphone 3.0 its give some leak message in the log screen..
That message is
2009-10-13 03:26:31.841 Spectrum[3946:4c2b] *** _NSAutoreleaseNoPool(): Object 0xd819d0 of class NSCFString autorele...
Hi all,
I am getting this error message in the console:
*** _NSAutoreleaseNoPool(): Object 0x10d2e0 of class NSPathStore2
autoreleased with no pool in place - just leaking
I can't figure out what is the error?
Thanks.
...
Hi everyone, I am new to C++ and have just started to work on a project using threading.
Currently my project involves the OpenGL and OpenCV libraries, and in the process of coding I encountered the following error :
Current language: auto; currently c++
2009-12-21 14:54:49.438 3DTestApp[3210:7803] *** _NSAutoreleaseNoPool(): Objec...
My app freezes whenever I parse an XML feed.
I have tried calling this instead:
[NSThread detachNewThreadSelector:@selector(parseXML) toTarget:self withObject:nil];
which calls:
-(void) parseXML {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[self parseXMLFileAtURL:path];
[pool drain];
}
but my app has ...
I'm doing some lazy loading of images into an array when the app has loaded. I have tried using an NSMutableArray and an NSArray (I don't need to alter the array once it's been created) but the latter crashes on me.
...
[self performSelectorInBackground:@selector(loadImageArrays) withObject:nil];
...
- (void)loadImageArrays {
NSAu...
Hi,
I have a problem with the memory management in Objective-C. Say I have a method that allocates an object and stores the reference to this object as a member of the class. If I run through the same function a second time, I need to release this first object before creating a new one to replace it. Supposing that the first line of ...
I am developing an application that needs to work on Linux, Windows and Mac OS X. To that purpose, I am using C++ with Qt.
For many reasons, on Mac OS X, I need to use CoreFoundation functions (such as CFBundleCopyBundleURL) that creates core objects that need to be released with CFRelease. But doing so generate a lots of these warnings...
I've followed the guides helpfully linked here:
http://stackoverflow.com/questions/295778/iphone-debugging-pointer-being-freed-was-not-allocated-errors
but the malloc_history is really throwing me for a loop, can anyone shed any light on the following:
ALLOC 0x185c600-0x18605ff [size=16384]: thread_a068a4e0 |start | main | UIApplicati...
I am trying to launch a background thread to retrieve XML data from a web service. I developed it synchronously - without threads, so I know that part works. Now I am ready to have a non-blocking service by spawning a thread to wait for the response and parse.
I created an NSAutoreleasePool inside the thread and release it at the end ...
This is the body of the selector that is specified in NSThread +detachNewThreadSelector:(SEL)aSelector toTarget:(id)aTarget withObject:(id)anArgument
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
while (doIt)
{
if (doItForSure)
{
NSLog(@"checking");
doItForSure = NO;
...
Hello,
i have an app that starts with the default code for iPhone Apps:
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
Cause my app never stopps, the [pool release] is never called. Has the standard UI loop of UIApplicationMain an own AutoreleasePool ...
i.e. would cause the object to be released immediately and not have to be released by the pool if I did this?
[[NSArray arrayWithCapacity:100] release];
Can't find a clear explanation in the docs about this.
...
Hi
I am very new to Objective-C and was reading through memory management. I was trying to play around a bit with the NSAutoreleasePool but somehow it wont release my object.
I have a class with a setter and getter which basically sets a NSString *name. After releasing the pool I tried to NSLog the object and it still works but I guess...
I have a "sync" task that relies on several "sub-tasks", which include asynchronous network operations, but which all require access to a single NSManagedObjectContext. Due to the threading requirements of NSManagedObjectContexts, I need every one of these sub-tasks to execute on the same thread. Due to the amount of processing being don...
Hi!
I have a UIViewController and in that controller, i am fetching an image from a URL source. The image is fetched in a separate thread after which the user-interface is updated on the main thread. This controller is displayed as a page in a UIScrollView parent which is implemented to release controllers that are not in view anymore.
...
Hi, i am working on a map application, in that i like to drop the pins (as in Zillow apps) when ever user change the map view. I am using following code code. i am try to load the xml data from server using NSAutoreleasepool to do the xml parsing in the background thread.
(void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL...
My app is crashing when I try to post images in an HTTP request. I am trying to upload images to a server. The crash appears related to my autorelease pool because the crash is trapped at the [pool release] message.
Here is the crash report:
#0 0x326712f8 in prepareForMethodLookup ()
#1 0x3266cf5c in lookUpMethod ()
#2 0x32668f28 i...
Hi all,
I have an application that has been running fine since its launch over a year ago.
I developed it with iphone iOS 2.2.1 originally and tested and kept selling it up until 3.2 without issues.
Now it fails to launch with iOS4.
the app uses a non standard size for a UIPickerView (I don't think that's the problem but just mention...