I'm getting lots of leaks in my code, but none of the leaks point to any of my code (they are all UIKit methods).
I'm running 3.0.
Could someone tell me how I go about figuring out where these leaks are coming from?
I'm getting lots of leaks in my code, but none of the leaks point to any of my code (they are all UIKit methods).
I'm running 3.0.
Could someone tell me how I go about figuring out where these leaks are coming from?
I saw some other people complaining about this very issue.
Just more info: I ran Clang on the xcode build, and only had 1 leak reported (in a 3rd party framework), but that leak is certainly not being reported in instruments (running on the phone btw).
I'm getting NSSets, block-16, NCFString leaks.
Be careful about how you interpret the information about where the leaks occur. For example, it's not uncommon to leak "placeholder" strings -- default strings that are allocated early in object construction and then typically overridden by your own custom code. While you don't directly allocate the placeholders, you do need to handle the overriding correctly. In other words, the leaks are avoidable, and they are your fault, so to speak.
However, there are some leaks in the SDK. UIWebView definitely leaks a bit, for example.
Could you show us the call stack for the leak? (Instruments/View/Extended Detail to see the stack.)
Thanks for helping out.
All I'm doing is loading a uitableview here. But I do call an asyncimageview class for icon loading, and am using a Singleton class for the datasource.
Anyway, all the leaks for each type (i.e., GSEVENTs) report the exact same detail. The item that doesn't show all the detail doesn't report any of my classes or methods BTW.
Here are the snapshots:
I read somewhere about bugs in UIAccelerometer (which I need to use) that could cause the GSEVENT problems.
I paired down my cellforrow to the bare minimum, without any extra classes (except the singleton). Must be in the singleton then. I pretty much used the TheElements sample code to build that class.
Here is my cellForRowAtIndexPath now (even with this barbones, app still leaks, even when scrolling):
static NSString *myCell = @"myCell";
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:myCell];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:myCell] autorelease];
}
UILabel *l=[[[UILabel alloc] initWithFrame:CGRectMake(10,10,200,16)] autorelease];
l.backgroundColor=[UIColor blackColor];
l.font=[UIFont boldSystemFontOfSize:15];
l.textColor=[UIColor whiteColor];
l.text=[(NSDictionary *)[[News sharedNews].newsArray objectAtIndex:indexPath.row] objectForKey:@"text"];
[cell.contentView addSubview:l];
return cell;