ObjectAL-for-iPhone
ObjectAL-for-iPhone copied to clipboard
updating to iOS 8
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
try this:
void (*my_objc_msgSend)(id, SEL, bool) = (void (*)(id, SEL, bool)) objc_msgSend;
my_objc_msgSend(suspendStatusChangeTarget, suspendStatusChangeSelector, manualSuspendLock);
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);
}
PS made a fork/pull req with this fix