I’m trying to override a method in my cellForRowAtIndexPath method like this
cell.customSwitch {
- (void)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event
{
[super touchesEnded:touches withEvent:event];
NSLog(@"customSwitch touchesended");
}
};
however this isn’t working (I’m normally a Java guy :P). Any help would be much appreciated!
There are a lot of similarities between Objective-C and Java, but that’s not one of ’em. 😉
If you want to create a cell with a customized
-touchesEnded:withEvent:method, you’ll need to declare and define that class separately. Something like:Once you’ve done that, you can use MyCell in your
-cellForRowAtIndexPath:.