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 09-09-2011, 01:52 AM   #1 (permalink)
Registered Member
 
Join Date: Dec 2010
Location: Mission Viejo, CA
Age: 30
Posts: 271
Brandt is on a distinguished road
Default bad_exc_access error due to over releasing

In this code I have a problem with the highlighted line. When I visit this tableview for the second time, I need to put the checkmark back where it was as I am reusing this view twice....sorry I'm so rusty I haven't touched my app since April...I need to figure out why it is over released is it tableView or lastIndexPath...it will typically skip over the reset fields part unless i specifically call for a new game.

Code:
- (void)viewWillAppear:(BOOL)animated {
    BOOL resetFields = NO;
    if ([Singleton sharedSingleton].cellSelection == 0)
        resetFields = [Singleton sharedSingleton].resetTeam1SelectionView;
    else if ([Singleton sharedSingleton].cellSelection == 1)
        resetFields = [Singleton sharedSingleton].resetTeam2SelectionView;
    
    if (resetFields) {

        self.lastIndexPath = nil;
        
        NSIndexPath *topIndexPath = [NSIndexPath indexPathForRow:0 inSection:0];

        [self.tableView selectRowAtIndexPath:topIndexPath animated:NO scrollPosition:UITableViewScrollPositionMiddle];
        if ([Singleton sharedSingleton].cellSelection == 0)
            [Singleton sharedSingleton].resetTeam1SelectionView = NO;
        else if ([Singleton sharedSingleton].cellSelection == 1)
            [Singleton sharedSingleton].resetTeam2SelectionView = NO;
	}
  
    [self.tableView selectRowAtIndexPath:lastIndexPath animated:NO scrollPosition:UITableViewScrollPositionMiddle];
      
    [self.tableView reloadData];


//    [self setTitle: [[self listData] objectAtIndex:parentCellSelection]];

    [self.navigationItem setLeftBarButtonItem:nil animated:NO];
    [self.navigationItem setRightBarButtonItem:nil animated:NO];
    
    [super viewWillAppear:animated];
}
Brandt is offline   Reply With Quote
Old 09-09-2011, 02:17 AM   #2 (permalink)
Registered Member
 
Join Date: Dec 2010
Location: Mission Viejo, CA
Age: 30
Posts: 271
Brandt is on a distinguished road
Default

found something with google:

in "didSelectRowAtIndexPath"

I changed

lastIndexPath = indexPath;

to

lastIndexPath = [indexPath retain];
Brandt is offline   Reply With Quote
Reply

Bookmarks

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: 406
9 members and 397 guests
apatsufas, Eclectic, JackReidy, jeroenkeij, Sami Gh, tim0504, UMAD, yomo710, yuncarl28
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,672
Threads: 94,121
Posts: 402,904
Top Poster: BrianSlick (7,990)
Welcome to our newest member, yuncarl28
Powered by vBadvanced CMPS v3.1.0

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