Skip to content
This repository has been archived by the owner on Jun 2, 2018. It is now read-only.

UIAlertView bk_alertViewWithTitle:message:]: unrecognized selector sent to class #235

Closed
Spokane-Dude opened this issue Apr 16, 2014 · 7 comments

Comments

@Spokane-Dude
Copy link

This is the error message I'm getting, along with the stack trace:

    2014-04-16 09:52:57.892 SalonBook[51064:60b] +[UIAlertView bk_alertViewWithTitle:message:]: unrecognized selector sent to class 0x27585f0
    2014-04-16 09:52:57.896 SalonBook[51064:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[UIAlertView bk_alertViewWithTitle:message:]: unrecognized selector sent to class 0x27585f0'
    *** First throw call stack:
    (
        0   CoreFoundation                      0x03fee1e4 __exceptionPreprocess + 180
        1   libobjc.A.dylib                     0x02b388e5 objc_exception_throw + 44
        2   CoreFoundation                      0x0408b0e3 +[NSObject(NSObject) doesNotRecognizeSelector:] + 275
        3   CoreFoundation                      0x03fde50b ___forwarding___ + 1019
        4   CoreFoundation                      0x03fde0ee _CF_forwarding_prep_0 + 14
        5   SalonBook                           0x00014cac -[AppointmentsViewController bSaveAppointment:] + 2604
        6   libobjc.A.dylib                     0x02b4a880 -[NSObject performSelector:withObject:withObject:] + 77
        7   UIKit                               0x01c203b9 -[UIApplication sendAction:to:from:forEvent:] + 108
        8   UIKit                               0x01c20345 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
        9   UIKit                               0x01d21bd1 -[UIControl sendAction:to:forEvent:] + 66
        10  UIKit                               0x01d21fc6 -[UIControl _sendActionsForEvents:withEvent:] + 577
        11  UIKit                               0x01d21243 -[UIControl touchesEnded:withEvent:] + 641
        12  UIKit                               0x01c5fddd -[UIWindow _sendTouchesForEvent:] + 852
        13  UIKit                               0x01c609d1 -[UIWindow sendEvent:] + 1117
        14  UIKit                               0x01c325f2 -[UIApplication sendEvent:] + 242
        15  UIKit                               0x01c1c353 _UIApplicationHandleEventQueue + 11455
        16  CoreFoundation                      0x03f7777f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
        17  CoreFoundation                      0x03f7710b __CFRunLoopDoSources0 + 235
        18  CoreFoundation                      0x03f941ae __CFRunLoopRun + 910
        19  CoreFoundation                      0x03f939d3 CFRunLoopRunSpecific + 467
        20  CoreFoundation                      0x03f937eb CFRunLoopRunInMode + 123
        21  GraphicsServices                    0x048cd5ee GSEventRunModal + 192
        22  GraphicsServices                    0x048cd42b GSEventRun + 104
        23  UIKit                               0x01c1ef9b UIApplicationMain + 1225
        24  SalonBook                           0x00002c3d main + 141
        25  libdyld.dylib                       0x0302b701 start + 1
    )
    libc++abi.dylib: terminating with uncaught exception of type NSException
    (lldb)

This is the code I'm trying to get to run; notice that it's from the example given on GitHub. No matter if I leave the bk_cancelBlock in or out, I get the same thing. NOTHING works under BlocksKit 2.2.2! And there are NO build errors.

        UIAlertView *testView = [UIAlertView bk_alertViewWithTitle: @"Very important!"
                                                               message: @"Do you like chocolate?"];
        bk_cancelBlock: ^{ return; };
@HaloZero
Copy link

I'm getting something similar, any idea what it is?

@Spokane-Dude
Copy link
Author

HaloZero: as you can see, it's been about 2 months and no response from the author; I gave up and removed all of his code from my app... can't afford to have stuff that doesn't work or get any support in any of my apps on the App Store. Good Luck with it...

@DenTelezhkin
Copy link

In defense of BlocksKit, original issue has no connection to it's implementation. This code runs perfectly on latest BlocksKit in my application:

UIAlertView *testView = [UIAlertView bk_alertViewWithTitle: @"Very important!"
                                                   message: @"Do you like chocolate?"];
[testView bk_setCancelBlock:^{
    NSLog(@"foo");
}];

[testView show];

@HaloZero
Copy link

Yeah, I'm getting it for ANY selector. it seems like something about the codebase I'm on + BlockKit doesn't get along. Not sure what it is though

@HaloZero
Copy link

Like even

    [@[@"Test", @"test2"] bk_each:^(id obj) {
        NSLog(@"whee");
    }];

doesn't seem to work, throwing an unrecognized selector issue.

@zwaldowski
Copy link
Collaborator

BlocksKit ships as a set of categories, sometimes there is difficulty in integrating it into the project. It is not faulty in design to the best of our knowledge and effort. The -ObjC linker flag is not snake oil. We have provided documentation on using it and I recommend it.

We cannot claim responsibility for integration issues. I spend enough of my workday fixing Xcode issues, and they are not insurmountable.

The README fully addresses manual installation, and if you are encountering that much trouble, I highly recommend CocoaPods as I always have. Thanks.

@HaloZero
Copy link

Sorry about that zwald, it's definitely an integration issue and this Github Issue was probably not the place for that discussion. I just noticed the issue and was hoping that the other commenter had a solution/guidance. Spokane-dude seems to have entitlement issues though :/

For anyone else reading this, the issue ended up being the Pods project inside Xcode was not building the right architecture, but it wouldn't throw an error, just a warning.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants