Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Samppaa

macrumors regular
Original poster
Mar 26, 2010
168
23
Hey I am making application where the program constantly downloads webpage in background and compares it to the old one, so I need thread for this I did this to my function where it starts getting the webpage [self performSelectorInBackground:mad:selector(testFunction) withObject:nil];

Yes, it keeps running the function, but I get error in console

Here is the test function
Code:
-(void)testFunction
{
    int i = 0;
    while(true) {
         [statusText setIntValue:i];
         i++;
    }
}

I get this error
Code:
2010-07-05 17:22:46.517 Checker[1797:4b0f] *** __NSAutoreleaseNoPool(): Object 0x10014ddb0 of class NSCFNumber autoreleased with no pool in place - just leaking
 
I read the guide abit but I missed the autorelease pool part, thanks so much! Thread programming is so easy in cocoa I love this.
 
The second thing it'll tell you is: never change the UI from within a thread. Which is likely the next issue you'll run into ;)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.