Hi there,
I have this problem, my programme works a treat but when I scroll down the table view it is fine, but then, after it gets to the last cell from the array, if I continue to scroll down it duplicates some of the items which have already been displayed and puts them into cells again.
The array is read from plist files.
here is the method.
not sure if the problem is here?
quite new to this and a bit confused. If anyone has any ideas that would be great.
thanks
moomy
I have this problem, my programme works a treat but when I scroll down the table view it is fine, but then, after it gets to the last cell from the array, if I continue to scroll down it duplicates some of the items which have already been displayed and puts them into cells again.
The array is read from plist files.
here is the method.
Code:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return myList.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
// Configure the cell.
cell.textLabel.text = [myList objectAtIndex:indexPath.row];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
}
not sure if the problem is here?
quite new to this and a bit confused. If anyone has any ideas that would be great.
thanks
moomy