Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-15-2011, 05:31 PM   #1 (permalink)
Registered Member
 
Join Date: Mar 2011
Posts: 6
satupled66 is on a distinguished road
Unhappy Problem with leak

Hello guys,

I just wanted to know if anyone here can help me finding out how to get rid of a leak that has been bothering me for a while, but I have no clue on how to solve it. It's an iPhone app and I'm testing on a 3G iPhone, not the simulator. Here's the code:

Code:
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *CellIdentifier = @"BaseCell";
    
    BaseCell *cell = (BaseCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
		
		[[NSBundle mainBundle] loadNibNamed:@"IndividualCell" owner:self options:nil]; //This is the line causing the leak as shown by the leaks instrument...
        cell = tmpCell;
        self.tmpCell = nil;
	}	
    // Configure the cell.
    NSArray *arr = [self.iconList objectForKey:@"inicio"];
	
	cell.icon = [UIImage imageNamed:[arr objectAtIndex:indexPath.row]];
	cell.numLines = 2;
	cell.name = NSLocalizedString(([NSString stringWithFormat:@"RootViewController_%@", [self.menu objectAtIndex:indexPath.row]]),@"");
	cell.fontSize = 21;
	cell.textColor = [UIColor whiteColor];
	cell.accessoryImage = [UIImage imageNamed:[self.iconList objectForKey:@"arrow"]];
	cell.backgroundImage = [UIImage imageNamed:[self.iconList objectForKey:@"backgroundCell"]];
	cell.selectedBackgroundImage = [UIImage imageNamed:[self.iconList objectForKey:@"selectedBackgroundCell"]];
	
	return [cell autorelease];
}
Thank you all for your help! Any kind of clue will be really valuable for me!
satupled66 is offline   Reply With Quote
Old 08-15-2011, 06:08 PM   #2 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

It's not here. My guess is that you aren't releasing all of your properties in dealloc in the cell class. What kind of object is being leaked?

Why is there a naming mismatch between IndividualCell and BaseCell?
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 08-16-2011, 09:36 AM   #3 (permalink)
Registered Member
 
Join Date: Mar 2011
Posts: 6
satupled66 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
It's not here. My guess is that you aren't releasing all of your properties in dealloc in the cell class. What kind of object is being leaked?

Why is there a naming mismatch between IndividualCell and BaseCell?
Thank you Brian, there were actually two properties commented out from the dealloc in the IndividualCell class. This code is actually from someone I'm replacing at the office and I'm not really experienced with objective-C or iPhone programming so I don't actually know why BaseCell is being declared there. This solution worked for app startup but whenever I change views, the leaks come back. The leaked object is called GeneralBlock-16. Thanks for helping!
satupled66 is offline   Reply With Quote
Reply

Bookmarks

Tags
iphone, leak, loadnibnamed, nsbundle

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 393
13 members and 380 guests
7twenty7, chiataytuday, cristofercolmbos, dedeys78, dre, fiftysixty, gmarro, jimmyon122, jonathandeknudt, pungs, raymng, tymex, UMAD
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,669
Threads: 94,121
Posts: 402,903
Top Poster: BrianSlick (7,990)
Welcome to our newest member, dedeys78
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:08 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0