(NSInteger)subRow
{
id indexpath = [NSIndexPath class];
id subRowObj = objc_getAssociatedObject(indexpath, SubRowObjectKey);
return [subRowObj integerValue];
}
(void)setSubRow:(NSInteger)subRow
{
id subRowObj = [NSNumber numberWithInteger:subRow];
id indexpath = [NSIndexPath class];
objc_setAssociatedObject(indexpath, SubRowObjectKey, subRowObj, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
My solution but i don't know whether it is the best
When i use in IOS7. in here objc_setAssociatedObject will crash.