"* Assertion failure in -[PlayingCell layoutSublayersOfLayer:], /SourceCache/UIKit_Sim/UIKit-2372/UIView.m:5776 2013-11-01 18:44:12.526 SnapTrack[216:c07] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Auto Layout still required after executing -layoutSubviews. PlayingCell's implementation of -layoutSubviews needs to call super.'"
I'm trying to run my app (which I designed for iOS7) in the iOS6 simulator. My project contains a TabBarController. In the first view controller in the tabbarcontroller I have a table view containing custom UITableViewCell's. They load without a problem. However, when I switch to another tab, where I have another table view, also with custom cells, I get the error posted above. The viewControllers are set up almost identically (both have subviews organized with auto layout). Has anyone seen this exception/know how to address it?
Thanks!
EDIT: Code for PlayingCell.
#import <UIKit/UIKit.h>
@interface PlayingCell : UITableViewCell
@property (strong, nonatomic) IBOutlet UILabel *lblTrackNum;
@property (strong, nonatomic) IBOutlet UIImageView *albumArt;
@property (strong, nonatomic) IBOutlet UILabel *lblSongTitle;
@property (strong, nonatomic) IBOutlet UILabel *lblAlbumTitle;
@property (strong, nonatomic) IBOutlet UILabel *lblArtist;
@property (strong, nonatomic) IBOutlet UIImageView *imgPlay;
@property (strong,nonatomic) NSMutableDictionary *songInfo;
- (IBAction)downloadBtnPressed:(id)sender;
@end
#import "PlayingCell.h"
@implementation PlayingCell
@synthesize songInfo;
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// Initialization code
}
return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
- (IBAction)downloadBtnPressed:(id)sender
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[songInfo objectForKey:@"trackViewUrl"]]];
NSLog(@"%@",[songInfo objectForKey:@"trackViewUrl"]);
}
-(void)layoutSubviews
{
[super layoutSubviews];
}