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

reported crash for 0.0.7 #180

Open
ConfusedVorlon opened this issue Aug 26, 2015 · 3 comments
Open

reported crash for 0.0.7 #180

ConfusedVorlon opened this issue Aug 26, 2015 · 3 comments

Comments

@ConfusedVorlon
Copy link

I'm seeing a handful of crashes reported through crashlytics. I don't have a way to reproduce these directly, so this may not be very helpful. I do have a stack trace though, so I thought it worth posting.

these are all for iPhone running iOS8 displaying with:

NSDictionary *options = @{
                          kCRToastTextKey : message,
                          kCRToastTextAlignmentKey : @(NSTextAlignmentCenter),
                          kCRToastBackgroundColorKey : [UIColor lightGrayColor],
                          kCRToastTextColorKey : [UIColor orangeOff],
                          kCRToastAnimationInTypeKey : @(CRToastAnimationTypeGravity),
                          kCRToastAnimationOutTypeKey : @(CRToastAnimationTypeGravity),
                          kCRToastAnimationInDirectionKey : @(CRToastAnimationDirectionTop),
                          kCRToastAnimationOutDirectionKey : @(CRToastAnimationDirectionTop)
                          };

[CRToastManager showNotificationWithOptions:options
                            completionBlock:^{

                            }];




Fatal Exception: NSInternalInconsistencyException

Invalid size {375, 0} for item <CRToastView: 0x157e7ba00; frame = (0 0; 375 0); userInteractionEnabled = NO; layer = <CALayer: 0x17022c220>>; in Dynamics

Thread : Fatal Exception: NSInternalInconsistencyException
0  CoreFoundation                 0x0000000182eb022c __exceptionPreprocess
1  libobjc.A.dylib                0x0000000194b7c0e4 objc_exception_throw
2  CoreFoundation                 0x0000000182eb00ec +[NSException raise:format:]
3  Foundation                     0x0000000183d64ed4 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]
4  UIKit                          0x00000001880b6ef8 -[UIDynamicAnimator _registerBodyForItem:shape:]
5  UIKit                          0x00000001880bae58 -[UIGravityBehavior _addItem:]
6  UIKit                          0x00000001880bb5e8 -[UIGravityBehavior _associate]
7  UIKit                          0x00000001880b4a30 -[UIDynamicAnimator _registerBehavior:]
8  Off                            0x000000010014ce18 -[CRToastManager displayNotification:] (CRToast.m:1304)
9  Off                            0x000000010014c1ec -[CRToastManager addNotification:] (CRToast.m:1210)
10 Off                            0x000000010014abc4 +[CRToastManager showNotificationWithOptions:completionBlock:] (CRToast.m:1075)
@bimusiek
Copy link

bimusiek commented Nov 2, 2015

I started getting the same crashes. Anyone already figured it out?

@bimusiek
Copy link

bimusiek commented Nov 2, 2015

I found issue, it crashes when you try to present CRToast when status bar is hidden.

@property(nonatomic,readonly) CGRect statusBarFrame; // returns CGRectZero if the status bar is hidden

Because it is 0, UIDynamic will crash it.

@bimusiek
Copy link

bimusiek commented Nov 2, 2015

The easiest fix, and this is what I did:

kCRToastNotificationTypeKey: [UIApplication sharedApplication].isStatusBarHidden?@(CRToastTypeNavigationBar):@(CRToastTypeStatusBar)

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

2 participants