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

CustomSegmentedControls crashes in iOS3.x #12

Open
orff opened this issue Sep 20, 2011 · 0 comments
Open

CustomSegmentedControls crashes in iOS3.x #12

orff opened this issue Sep 20, 2011 · 0 comments

Comments

@orff
Copy link

orff commented Sep 20, 2011

the call to UIGraphicsBeginImageContextWithOptions

in CustomSegmentedControlsViewController is not OS3.x friendly. It will crash because the call is a C call and not Obj C.

Here is a fix ( May not work well with non opaque images, but stops the crashing):

    CGSize size = CGSizeMake(buttonWidth, image.size.height);
if (UIGraphicsBeginImageContextWithOptions!=NULL) {
    UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);
} else {
    UIGraphicsBeginImageContext(size);  
}
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

1 participant