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

Invalid context warning in landscape #13

Closed
Jack-s opened this issue Jul 30, 2014 · 3 comments
Closed

Invalid context warning in landscape #13

Jack-s opened this issue Jul 30, 2014 · 3 comments

Comments

@Jack-s
Copy link

Jack-s commented Jul 30, 2014

When launching an ActionSheetPicker in landscape mode I get a "invalid context warning" in the console. Aside from the warning it seems to work OK.

The error reads something like the following

Jul 30 11:29:49 .... ActionSheetPicker[5133] : CGContextSetFillColorWithColor: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.

I can get rid of the error by modifying the configureAndPresentActionSheetForView: method in AbstractActionSheetPicker.m to pass in an empty string instead of nil when creating the actionSheet

https://github.com/skywinder/ActionSheetPicker-3.0/blob/master/Pickers/AbstractActionSheetPicker.m#L424

From

_actionSheet = [[UIActionSheet alloc] initWithTitle:paddedSheetTitle delegate:nil cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil];

To

_actionSheet = [[UIActionSheet alloc] initWithTitle:paddedSheetTitle delegate:nil cancelButtonTitle:@"" destructiveButtonTitle:nil otherButtonTitles:nil];

However while the context error goes away the picker isn't displayed correctly.

screen shot 2014-07-30 at 11 40 33 am

The error only seems to be on iOS 7. You can test this by running the example project and switching to landscape mode.

@Jack-s
Copy link
Author

Jack-s commented Aug 12, 2014

With the new update I'm no longer getting the warning, of course as of now landscape doesn't work at all due to issue #17 so I'm going to leave this issue open for now.

@skywinder
Copy link
Owner

@Jack-s ok, #17 is fixed. I don't see it too.
Please, check, is this warning gone?

@Jack-s
Copy link
Author

Jack-s commented Aug 13, 2014

Seems to be, thanks.

@Jack-s Jack-s closed this as completed Aug 13, 2014
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