I put a DragView (subclass of UIView) on a UITableViewCell with tag (row+20000)
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSInteger row=[indexPath row];
NSInteger section=[indexPath section];
static NSString *SimpleTableIdentifier1 = @"CellTableIdentifier";
UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier: SimpleTableIdentifier1 ];
if (cell == nil) {
cell=[[[UITableViewCell alloc] initWithFrame:CGRectZero
CGRect dragRect =CGRectMake(12.0f,6.0f,24.0f,24.0f);
DragView *dragger =[[DragView alloc] initWithFrame:dragRect];
[dragger setTag: row+20000 ];
}
DragView *newDragger=(DragView*)[cell viewWithTag: row+20000 ];//error
//......
return cell;
}
But when I try to use the codes (line marks with 'error') to access the DragView, debugger shows that newDragger returns 0x0 which means no object.
I do not know where is wrong. I just guess there may be the reason of the amount limitation of maximium tag )
Welcome any comment.
Thanks
interdev