Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in iOS6.1 #139

Closed
wdragen opened this issue Apr 24, 2014 · 26 comments
Closed

Crash in iOS6.1 #139

wdragen opened this issue Apr 24, 2014 · 26 comments

Comments

@wdragen
Copy link
Contributor

wdragen commented Apr 24, 2014

I run this demo project on my iOS6.1 simulator. But got crashed with information belows:

2014-04-24 23:39:19.772 SWTableViewCell[17539:907] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Auto Layout still required after executing -layoutSubviews. SWTableViewCell's implementation of -layoutSubviews needs to call super.'

Any one occurs?

@wdragen
Copy link
Contributor Author

wdragen commented Apr 25, 2014

@CEWendel

@CEWendel
Copy link
Owner

I am in the middle of finals week at school right now I will try to take a look at this today or this weekend.

Sent from my iPhone

On Apr 25, 2014, at 11:05 AM, SFeng notifications@github.com wrote:

@CEWendel


Reply to this email directly or view it on GitHub.

@CEWendel
Copy link
Owner

@zygoat have you encountered this?

@wdragen wdragen changed the title Carsh in iOS6.1 Crash in iOS6.1 Apr 28, 2014
@itsmeichigo
Copy link

I'm having the same problem. This should be due to some issues with the constraints programmatically added to SWTableViewCell.

@zygoat
Copy link
Contributor

zygoat commented Apr 28, 2014

Hmm… I do see this now when running under 6.1. I don't immediately understand the cause; even commenting out SWTableViewCell's implementation of layoutSubviews doesn't prevent the exception (whose literal message is obviously not entirely correct). Will see if I can figure it out.

@guogangj
Copy link

guogangj commented May 3, 2014

I have this problem too. Even I have confirmed that auto layout is not used at all.

@MobileVet
Copy link

Confirmed as an issue...

@mmrmmlrr
Copy link

mmrmmlrr commented May 7, 2014

Having same problem.

@KMidani
Copy link

KMidani commented May 7, 2014

I have this problem too.

@mmoloksher
Copy link

i can reproduce this as well

@CEWendel
Copy link
Owner

CEWendel commented May 8, 2014

I have heard of people having this problem before (autolayout and subclassed UITableViewCell's)

SO has a relevant post
http://stackoverflow.com/questions/12610783/auto-layout-still-required-after-executing-layoutsubviews-with-uitableviewcel

@CEWendel
Copy link
Owner

CEWendel commented May 8, 2014

Basically it seems like adding subviews directly to a UITableViewCell subclass and then adding constraints to those subviews causes problems (only in iOS 6, the problem does not seem to exist in iOS5 and 7...). @zygoat I recommend reading over that SO post, I am experimenting with some stuff now to see if I get this working on 6.x again.

Sorry about the latest release everybody, the last release before autolayout was 0.2.7 so feel free to put pod 'SWTableViewCell', '0.2.7' in your Podfile while this is sorted out if you need this working on iOS6.

@maximep
Copy link

maximep commented May 22, 2014

Hello, I'm having the same issue. If I turn to use the 0.2.7 version it results as I cannot see any cell anymore.

@MobileVet
Copy link

I submitted a pull request that resolves this bug.

@zygoat
Copy link
Contributor

zygoat commented May 22, 2014

Thanks @MobileVet and others for picking this up. I must take responsibility for breaking it on iOS 6 with the view hierarchy changes I implemented; unfortunately I've been busy the last few weeks and haven't had a chance to dig into it, short of some initial research that led me to appreciate (and cringe at) the awkward scope of the issue. I also left a comment on #160 with rationale behind the original changes.

@jakebontune
Copy link

Also having this problem. Any progress with this? Would really like to use this in iOS 6.1 and up.

@MobileVet
Copy link

I have posted a pull request that resolves the bug. Check it out

On Sunday, May 25, 2014, Kolade Joseph Ayo-Vaughan notifications@github.com
wrote:

Also having this problem. Any progress with this? Would really like to use
this in iOS 6.1 and up.


Reply to this email directly or view it on GitHubhttps://github.com//issues/139#issuecomment-44126768
.

@maximep
Copy link

maximep commented May 26, 2014

@MobileVet I tried to integrate your fix on my projet but I still have issues with it. It's not crashing anymore but when I add buttons on left and right subviews I don't have the expected behavior.

@jakebontune
Copy link

@MobileVet I'm still getting these errors even after your fix:

Assertion failure in -[JVMessageCell layoutSublayersOfLayer:], /SourceCache/UIKit/UIKit-2380.17/UIView.m:5776

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Auto Layout still required after executing -layoutSubviews. JVMessageCell's implementation of -layoutSubviews needs to call super.'

JVMessageCell is a subclass of UITableViewCell fyi. Any ideas why?

@bawn
Copy link

bawn commented Jul 14, 2014

I have the same problem, hoping to quickly solve

@jakebontune
Copy link

Decided to only support iOS 7 and up. Life has never been better.

@jayendra02
Copy link

I am using xcode 5.1 and I have customized the cell.I also have same issue in ios6.

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Auto Layout still required after executing -layoutSubviews. SWTableViewCell's implementation of -layoutSubviews needs to call super.'

@abdi7
Copy link

abdi7 commented Aug 5, 2014

Any fix for this?I am having the same problem for all deployment targets.the exception shows:[super layoutsubviews] but even commenting the whole layoutsubviews seems to through the same exception..running on a tight deadline,would really appreciate some help.

@farhanpatel
Copy link

@abdi7 your best bet is to go to an older version. The only thing it changes is you have to calculate the height yourself instead of having autolayout do it. The author has chosen to move on to support only ios7 and above.

@CEWendel
Copy link
Owner

CEWendel commented Aug 9, 2014

Yeah version 0.2.7 is the last one that fully supports iOS 6. This is for two reasons, for one, iOS 7 or above has now been adopted by almost 90% of users. Also, I am now completely living on OS X Yosemite, which does not support the iOS 6 Simulator.

@debugly
Copy link

debugly commented Jan 26, 2016

I'm having the same issue,i was solved :

//SWTableViewCell 
- (void)layoutSubviews
{
   //fix iOS6 crash: “Auto Layout still required after executing -layoutSubviews”
    NSString *systemVersion = [UIDevice currentDevice].systemVersion;
    bool iOS6 = [systemVersion hasPrefix:@"6."];
    if(!iOS6) {
        [super layoutSubviews];
    }
    // Offset the contentView origin so that it appears correctly w/rt the enclosing scroll view (to which we moved it).
    CGRect frame = self.contentView.frame;
    frame.origin.x = [self leftUtilityButtonsWidth];
    _contentCellView.frame = frame;

    self.cellScrollView.contentSize = CGSizeMake(CGRectGetWidth(self.frame) + [self utilityButtonsPadding], CGRectGetHeight(self.frame));

    if (!self.cellScrollView.isTracking && !self.cellScrollView.isDecelerating)
    {
        self.cellScrollView.contentOffset = [self contentOffsetForCellState:_cellState];
    }

    [self updateCellState];

    if(iOS6) {
        [super layoutSubviews];
    }
}

anivaros pushed a commit to anivaros/SWTableViewCell that referenced this issue Jun 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests