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

NSInternalInconsistencyException #40

Closed
ghost opened this issue Mar 19, 2014 · 13 comments
Closed

NSInternalInconsistencyException #40

ghost opened this issue Mar 19, 2014 · 13 comments
Labels

Comments

@ghost
Copy link

ghost commented Mar 19, 2014

I am calling CRToast from UIViewcontroller with below code;

(void) userParamsSaved {
NSDictionary *options = @{
kCRToastTextKey : @"Hello World!",
kCRToastTextAlignmentKey : @(NSTextAlignmentCenter),
kCRToastBackgroundColorKey : [UIColor redColor],
kCRToastAnimationInTypeKey : @(CRToastAnimationTypeGravity),
kCRToastAnimationOutTypeKey : @(CRToastAnimationTypeGravity),
kCRToastAnimationInDirectionKey : @(CRToastAnimationDirectionLeft),
kCRToastAnimationOutDirectionKey : @(CRToastAnimationDirectionRight)
};
[CRToastManager showNotificationWithOptions:options
completionBlock:^{}];

}
and get

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid size {320, 0} for item <CRToastView: 0x1093935f0; frame = (-320 0; 320 0); userInteractionEnabled = NO; layer = <CALayer: 0x10932fd70>> in Dynamics'

what i am missing?

@cruffenach
Copy link
Owner

I just tried that exact code in the demo project and everything worked fine. Some questions for you.

What version are you using?
Does this happen every time or is it intermittent?
Does this code work for you when used to replace these lines?
What version of iOS is this running on?

@ghost
Copy link
Author

ghost commented Mar 19, 2014

I am using the latest version as of March 19, 2014
It is happening every time
IOS 7.0
I downloaded and run the demo project and it worked on simulator and phone. What i am thinking of that SWRevealController and CRToast messing each other. It must be because of the view.frame.size issue.

@cruffenach
Copy link
Owner

Interesting, is there a demo project you could set up showing this problem?

@ghost
Copy link
Author

ghost commented Mar 19, 2014

I am attaching screen captures of the .h .m and debug output.

screen shot 2014-03-19 at 23 34 07
screen shot 2014-03-19 at 23 32 49
screen shot 2014-03-19 at 23 31 52

@Ashton-W
Copy link
Collaborator

Please copy the text into a gist https://gist.github.com/

@Ashton-W
Copy link
Collaborator

Ashton-W commented May 5, 2014

Since this discussion has died down and we don't have any information or action items, I'm closing this.

@Ashton-W Ashton-W closed this as completed May 5, 2014
@postmechanical
Copy link

This occurs if the status bar is hidden and there is no navigation bar.

@Ashton-W
Copy link
Collaborator

Ashton-W commented May 8, 2014

I haven't run into this myself, could you create a quick demo project @postmechanical? Either fork this repo or do your own thing.

@Ashton-W Ashton-W reopened this May 8, 2014
@Ashton-W Ashton-W added the bug label May 8, 2014
@postmechanical
Copy link

There's already one floating around out there: https://github.com/sircharleswatson/CRToastDemo

It sets kCRToastNotificationTypeKey to CRToastTypeNavigationBar to work around the problem in a status bar hidden and non-navigation bar app. It seems that there should be an assert sooner that CRToast is only supported with status bar or navigation bar visible, or support added for status bar sized notification in status bar and navigation bar hidden context.

@cruffenach
Copy link
Owner

Thanks @postmechanical I will check it out

@Ashton-W
Copy link
Collaborator

Ashton-W commented May 9, 2014

I am not getting an exception in that demo app (iOS sim 7.0.3, 7.1). I do see the statusbar become visible when it shouldn't, but that is a different issue.

@spencerdcarlson
Copy link

@postmechanical using kCRToastNotificationTypeKey : CRToastType.NavigationBar.rawValue also fixed this issue for me. Thanks

@LegoTechApps
Copy link

StatusBar must be visible

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
Projects
None yet
Development

No branches or pull requests

5 participants