UITableViewCell error ios7
I have a problem, I have a table and in each cell a UISwitch. When the
user clicks the switch I would like to know which cell contained the
switch.
The code is working fine in ios6 and in ios 7 breaks:
The code is like this:
-(IBAction) doToggle:(id)sender {
UISwitch *toggle = (UISwitch *)sender;
MyCell *cell = (MyCell *)((UISwitch *)sender).superview.superview;
NSLog(@"=========== CELL %@", cell.description);
NSDictionary *item = [list objectAtIndex:[cell index]]; //breaks in this line
In the NSLog I see the following
iOS6:
<MyCell: 0x858b750; baseClass = UITableViewCell; frame = (0 0; 320 44);
autoresize = W; layer = <CALayer: 0x858b890>>
iOS7:
<UITableViewCellScrollView: 0x8e5a290; frame = (0 0; 320 44); autoresize =
W+H; gestureRecognizers = <NSArray: 0x8e5a740>; layer = <CALayer:
0x8e5a4c0>; contentOffset: {0, 0}>
Can some one help me with this, Thanks in advance!
No comments:
Post a Comment