Hallo,
ich bin neu was die Iphone Entwivklung angeht und habe, wie soll es auch anders sein, ein Problemchen.
Ich habe eine App in der ich eine Tabbar mit drei Buttons habe.
In der ersten View habe ich eine Tableview mit header und footer,Navigationcontroller eingebaut.
Der Headerview besitz ein Bild und der Footer ist noch leer.
Die APP compiliert ohne meckern und läuft auch.
Wenn ich aber Scrollen möchte, stürzt die APP ab mit
EXC_BAD_ACCESS
Wenn ich aber nur 1-2 Zeilen scrolle läuft sie weiter.
Switche ich vorher durch die Tabs und scrolle dann kommt folgende Fehlermeldung:
[__NSCFType tableView:cellForRowAtIndexPath:]: unrecognized selector sent to instance 0x5319450
2011-02-18 10:23:16.101 HartmannApp01[981:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType tableView:cellForRowAtIndexPath:]: unrecognized selector sent to instance 0x5319450'
*** Call stack at first throw:
Mein Code sieht so aus:
Alles anzeigen
Vielen Dank für eure Hilfe
Gruss Copy
ich bin neu was die Iphone Entwivklung angeht und habe, wie soll es auch anders sein, ein Problemchen.
Ich habe eine App in der ich eine Tabbar mit drei Buttons habe.
In der ersten View habe ich eine Tableview mit header und footer,Navigationcontroller eingebaut.
Der Headerview besitz ein Bild und der Footer ist noch leer.
Die APP compiliert ohne meckern und läuft auch.
Wenn ich aber Scrollen möchte, stürzt die APP ab mit
EXC_BAD_ACCESS
Wenn ich aber nur 1-2 Zeilen scrolle läuft sie weiter.
Switche ich vorher durch die Tabs und scrolle dann kommt folgende Fehlermeldung:
[__NSCFType tableView:cellForRowAtIndexPath:]: unrecognized selector sent to instance 0x5319450
2011-02-18 10:23:16.101 HartmannApp01[981:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType tableView:cellForRowAtIndexPath:]: unrecognized selector sent to instance 0x5319450'
*** Call stack at first throw:
Mein Code sieht so aus:
PHP-Quellcode
- - (void)viewDidLoad
- {
- self.tableArray = [NSArray arrayWithObjects:@"Eintrag1", @"Eintrag2", @"Eintrag3", nil];
- self.tableArray2 = [NSArray arrayWithObjects: @"Eintrag2_1",@"Eintrag2_2", nil];
- CGRect newFrame = CGRectMake(0.0, 0.0, self.tableView.bounds.size.width, self.myHeaderView.frame.size.height);
- self.myHeaderView.backgroundColor = [UIColor clearColor];
- self.myHeaderView.frame = newFrame;
- self.tableView.tableHeaderView = self.myHeaderView;
- newFrame = CGRectMake(0.0, 0.0, self.tableView.bounds.size.width, self.myFooterView.frame.size.height);
- self.myFooterView.backgroundColor = [UIColor clearColor];
- self.myFooterView.frame = newFrame;
- self.tableView.tableFooterView = self.myFooterView;
- }
- - (void)viewDidUnload
- {
- self.myHeaderView = nil;
- self.myFooterView = nil;
- self.tableArray = nil;
- self.tableArray2 = nil;
- }
- - (void)dealloc
- {
- [myFooterView release];
- [myHeaderView release];
- [tableArray release];
- [tableArray2 release];
- [super dealloc];
- }
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- {
- if (section==0)
- {
- return [tableArray count];
- }
- if (section==1)
- {
- return [tableArray2 count];
- }
- return 0;
- }
- - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
- {
- return 2;
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- static NSString *kCellID = @"cellID";
- UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellID];
- if (cell == nil)
- {
- NSLog(@"war NIL");
- cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kCellID] autorelease];
- [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
- }
- if(indexPath.section == 0)
- cell.textLabel.text = [tableArray objectAtIndex:indexPath.row];
- else
- cell.textLabel.text = [tableArray2 objectAtIndex:indexPath.row];
- return cell;
- }
- - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
- }
- @end
Vielen Dank für eure Hilfe
Gruss Copy
