I have a view defined in the interface builder that contains a subview that will be used to contain a custom tableview. The tableview is loaded into the subview in the viewDidLoad event of the view that contains it, and then upon being loaded does a bit of work on a provided list of items and populates the table accordingly.
Trouble is, when I load the tableView and attempt to perform any operations on it, I get a EXC_BAD_ACCESS error from the debugger:
PriceHistoryViewController.h
SellViewController.m - viewDidLoad()
Any message I send to priceHistoryTable produces an EXC_BAD_ACCESS error, but there's no apparent indication of the problem. According to my debugging the priceHistoryTable is being created successfully and it is not nil before I perform operations on it.
The doSomething method I call above is only supposed to put a message in the NSLog, but even that causes a problem. Ideas?
Trouble is, when I load the tableView and attempt to perform any operations on it, I get a EXC_BAD_ACCESS error from the debugger:
PriceHistoryViewController.h
Code:
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
@interface PriceHistoryViewController : UITableViewController {
NSMutableArray *priceList;
}
@property (nonatomic, retain) NSMutableArray *priceList;
- (void)sortAndColorPriceHistory;
- (void)setPriceList:(NSMutableArray *)priceArray;
- (void)doSomething;
@end
SellViewController.m - viewDidLoad()
Code:
// Implement viewDidLoad to do additional setup after loading the view.
- (void)viewDidLoad {
[super viewDidLoad];
if(priceHistoryTable == nil) {
PriceHistoryViewController *controller = [[PriceHistoryViewController alloc] initWithNibName:@"PriceHistoryView" bundle:[NSBundle mainBundle]];
priceHistoryTable = controller;
[controller release];
}
//....unrelated stuff
[priceHistoryTable doSomething];
[priceTableView addSubview:priceHistoryTable.view];
}
Any message I send to priceHistoryTable produces an EXC_BAD_ACCESS error, but there's no apparent indication of the problem. According to my debugging the priceHistoryTable is being created successfully and it is not nil before I perform operations on it.
The doSomething method I call above is only supposed to put a message in the NSLog, but even that causes a problem. Ideas?