Abrufen von "EXC_BAD_ACCESS" beim Zugriff auf die Instanzvariable über die UITableView-Delegatmethode
Meine iPhone-Anwendung wird beim Zugriff auf eine Instanzvariable über eine der UITableView-Delegatmethoden aktiviert. Ich glaube, ich behalte es bei, deshalb verstehe ich nicht, warum ich nicht problemlos darauf zugreifen kann.
Hier ist meine .h-Datei
#import <Foundation/Foundation.h>
#import "AlertSummaryCell.h"
#import "AlertDetailViewController.h"
@interface AlertSummaryTableViewController : UITableViewController {
NSDictionary *alerts;
NSString *alertKind;
}
@property (nichtatomar, beibehalten) NSDictionary * Warnungen; @property (nichtatomar, beibehalten) NSString * alertKind;
@Ende
In meiner .m-Datei stirbt die Anwendung beim ersten NSLog-Aufruf:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
NSLog(@"AlertSummaryTableViewController.numberOfRowsInSection entered");
NSLog(@" alerts description = %@", [alerts description]);
// To know how many alert summaries we have, get the value for count out of the input dictionary
int theCount = [[alerts objectForKey:@"count"] intValue];
NSLog(@" Going to return %d",theCount);
return theCount;
}
Was vermisse ich???
Bei der viewDidLoad-Methode gibt es überhaupt kein Problem:
- (void)viewDidLoad {
NSLog(@"AlertSummaryTableViewController.viewDidLoad entered");
NSLog(@" alerts description = %@", [alerts description]);
// We want the View title to include the alert count
// To know how many alert summaries we have, get the value for count out of the input dictionary
int theCount = [[alerts objectForKey:@"count"] intValue];
// Now construct the title text and set our views title to it
NSString *myTitle = [[NSString alloc] initWithFormat:@"%@ Alerts (%d)",alertKind,theCount];
[self setTitle: myTitle];
// Memory cleanup
[myTitle release];
[super viewDidLoad];
}