diff --git a/ARCMacros.h b/ARCMacros.h index 166d72d..77e3ee9 100644 --- a/ARCMacros.h +++ b/ARCMacros.h @@ -59,4 +59,5 @@ #define SAFE_ARC_AUTORELEASE_POOL_END() [pool release]; #endif - +#define FPPopoverWeakObject(o) __block __typeof__((__typeof__(o))o) +#define FPPopoverWeakSelf FPPopoverWeakObject(self) \ No newline at end of file diff --git a/FPPopoverController.m b/FPPopoverController.m index 18369ce..33dccdd 100644 --- a/FPPopoverController.m +++ b/FPPopoverController.m @@ -120,8 +120,7 @@ -(id)initWithViewController:(UIViewController*)viewController _touchView.clipsToBounds = NO; [self.view addSubview:_touchView]; - - __block typeof (self) bself = self; + FPPopoverWeakSelf bself = self; [_touchView setTouchedOutsideBlock:^{ [bself dismissPopoverAnimated:YES]; }];