UIActionSheet 传值

#pragma mark - actionSheet

- (void)shareOrder:(NSDictionary *)product

{

    UIActionSheet *as = [[UIActionSheet alloc] initWithTitle:VIMILocalizedString(@"分享", nil) delegate:self cancelButtonTitle:VIMILocalizedString(@"取消", nil) destructiveButtonTitle:nil otherButtonTitles:

                         @"分享给微信好友",

                         @"分享给QQ好友", 

                        @"晒单到QQ空间" ,  nil];

    objc_setAssociatedObject(as, @"product", product, OBJC_ASSOCIATION_RETAIN);

    [as showInView:self.view];

}

 - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {   

    NSDictionary *product = objc_getAssociatedObject(actionSheet, @"product");

    }

 

你可能感兴趣的:(action)