UIAlertView-Blocks icon indicating copy to clipboard operation
UIAlertView-Blocks copied to clipboard

Blocks are not working

Open davidhorvath opened this issue 10 years ago • 10 comments

Hi

If you use other cocoaPods , (e.g : TapjoySDK) beside UIAlertView+Blocks the blocks are not returning.

davidhorvath avatar Jan 14 '15 14:01 davidhorvath

Hi - I've used this pod with other pods many times - Perhaps this is a case of category collision? The TapjoySDK is closed-source, so I can't tell if they are doing anything to UIAlertView, but it seems to be problem when using this pod in conjunction with TapJoy. If I find a workaround i'll post it here.

ryanmaxwell avatar Jan 14 '15 22:01 ryanmaxwell

Yeah, i thought it's not necessarily the problem with your pod but i wanted you to know. Thanks for the answer.

davidhorvath avatar Jan 15 '15 08:01 davidhorvath

I have the same problem. Just wonder if there is any workaround available. I have been changing the category name and method name. but no luck

macinux avatar Feb 11 '15 20:02 macinux

@macinux are you using the same library (TapJoy) or is another incompatibility?

ryanmaxwell avatar Feb 11 '15 20:02 ryanmaxwell

yes. same library (TapJoy). thanks

macinux avatar Feb 11 '15 20:02 macinux

Unfortunately i had to use TapJoy library so i stopped using this category. My solution was to set my block as a property and called that from clickedButtonAtIndex.

typedef void (^TapBlock) (); @property (nonatomic, copy) TapBlock savedTapBlock;

  • (void)showAlertWithBlock:(TapBlock)block { self.savedTapBlock = block; // Show alertView }

  • (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { // ... if (_savedTapBlock) { _savedTapBlock(); }

    // ... }

davidhorvath avatar Feb 12 '15 09:02 davidhorvath

Thanks @DavidHorvath for sharing your solution. It would be good to find a permanent workaround

ryanmaxwell avatar Feb 12 '15 10:02 ryanmaxwell

The bug also repeated to me. After adding the lib: Tapjoy

AzotKZN avatar Feb 01 '16 18:02 AzotKZN

They should call it Tapsad.

ryanmaxwell avatar Feb 02 '16 04:02 ryanmaxwell

This is a category name collision. If you just change to (Blocks2) for example, it will work.

mattwilliamson avatar Nov 20 '16 03:11 mattwilliamson