Closed zebtin closed 13 years ago
Just to complement, now know this is related to Accessibility, but I still have not found a way to stop it from logging.
I encountered the same issue when using the control in a UITableViewCell. The TableView automagically checks for accessibility features on each cell and seems to dump the warning when the accessibility methods are not implemented.
Stacktrace:
Fix is quite simple, just implement the accessibility methods.
- (BOOL)isAccessibilityElement {
return YES;
}
- (NSString *)accessibilityLabel {
return NSLocalizedString(@"On off switch", nil);
}
- (UIAccessibilityTraits)accessibilityTraits {
return UIAccessibilityTraitButton;
}
- (NSString *)accessibilityHint {
if (self.on) {
return NSLocalizedString(@"Change switch to %@", self.offText);
} else {
return NSLocalizedString(@"Change switch to %@", self.onText);
}
}
Solved, thanks.
Everything works perfectly, events are fired correctly, and the control looks awsome.
But for some reason I get A LOT of these messages on the console:
....... ivar layout: offText = ON ivar layout: offText = OFF ivar layout: offText = ON ivar layout: offText = OFF ......
Has anyone found how to fix this or where it is coming from?