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

updating to iOS 8 #73

Open
brendancmiller opened this issue Oct 5, 2014 · 3 comments
Open

updating to iOS 8 #73

brendancmiller opened this issue Oct 5, 2014 · 3 comments

Comments

@brendancmiller
Copy link

upgrading my app to iOS 8. Getting the following error when building for the first time

OALSuspendHandler.m
"Too many arguments to function call, expected 0, have 3"
objc_msgSend

@Prometei7
Copy link

try this:

void (*my_objc_msgSend)(id, SEL, bool) = (void (*)(id, SEL, bool)) objc_msgSend;
my_objc_msgSend(suspendStatusChangeTarget, suspendStatusChangeSelector, manualSuspendLock);

@croesus
Copy link

croesus commented Nov 27, 2014

I got EXC_BAD_ACCESS from that fix when the method is invoked. Following this advice from StackOverflow (http://stackoverflow.com/questions/2650190/objective-c-and-use-of-sel-imp) seems to have fixed it:

    // Old code
    //id (*typed_msgSend)(id, SEL, bool) = (id (*)(id, SEL, bool))objc_msgSend;
    //typed_msgSend(suspendStatusChangeTarget, suspendStatusChangeSelector, manualSuspendLock);
    // New code
    if([suspendStatusChangeTarget respondsToSelector:suspendStatusChangeSelector])
    {
        id (*method)(id, SEL, bool)  = (id (*)(id, SEL, bool))[suspendStatusChangeTarget methodForSelector:suspendStatusChangeSelector];
        method(suspendStatusChangeTarget, suspendStatusChangeSelector, manualSuspendLock);
    }

@croesus
Copy link

croesus commented Nov 27, 2014

PS made a fork/pull req with this fix

kstenerud added a commit that referenced this issue Nov 30, 2014
Replace crashing objc_msgSend call with SEL/IMP approach Issue #73
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

3 participants