I simply updated to iOS 7.1 and I get an unrecognized selection error for a function called "_layoutCells".
I have a simple subclass of UITabBarController.
Note that this is a hack to avoid a bad crash until a better solution or explanation is found. I though I should share it.
Simply add the following method to your UITabBarController subclass implementation:
- (void) _layoutCells
{
// HACK ALERT: on iOS 7.1, this method will be called from deep within the bowels of iOS. The problem is that
// the method is not implemented and it results in an unrecognized selected crash. So we implement it...
//
// What could go wrong?
}
Thanks to GenesisST for giving his answer, but I know methods are called for a reason. And usually layoutCells will call layout for all subviews. While I rather wait for an answer from Apple, I like other people need to submit my app within a given timeline.
In my case, I was getting this error due to some hacks. I had replaced the UIMoreNavigationController delegate, which is an undocumented class by Apple, so I could expect errors. I am doing this hack to extend the More tab's functionality, and this error only occurs when I change the moreNavigationController tableView's delegate.
So I store their delegate, change it, then call _layoutCells to their delegate when iOS calls it on my class.
- (void)_layoutCells
{
if([self.moreTableViewDelegate respondsToSelector:@selector(_layoutCells)]){
[self.moreTableViewDelegate performSelector:@selector(_layoutCells)];
}
}
I don't know if this apply's to anyone here, but just in case someone else comes to SO with my edge case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With