Why does it crash the second time?

Hey guys, I'm new to Objective-C, and I'm making an app, and when you click on a table cell it does what it's supposed to, but when you go back and click on the cell the second time, it crashed with "EXC_BAD_ACCESS". Could you tell me what it means, and why is it only crashing the second time, and how could I fix it? I'm pretty sure it's in this function:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Navigation logic may go here. Create and push another view controller.

    RaceData * data = [self.units objectAtIndex:indexPath.row];
    ProtossInfo * info = [[ProtossInfo alloc] initWithNibName:@"ProtossInfo" bundle:nil];

     // ...
     // Pass the selected object to the new view controller.
    [self.navigationController pushViewController:info animated:YES];

    info.title = data.titler;
    info.minerals.text = data.min;
    info.vespene.text = data.vesp;
    info.supply.text = data.sup;
    info.portrait.image = data.porty;

    [info release];
    [data release];

}  

Answers


You're releasing data, which you didn't retain.


Need Your Help

Aggregation and Decomposition in JPA

java jpa aggregation decomposition

How do you implement aggregation and decomposition with Java Persistence API? What are the best practices?

How to write a struct to file in C++ and read the file?

c++ buffer readfile

I am new. I have some questions, any help would be appreciated.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.