iOS 中 Block实现UIAlertView
来源:互联网 发布:淘宝网平板电脑价格 编辑:程序博客网 时间:2024/06/06 03:05
#import "MKAlertView.h"#import <objc/runtime.h>staticconstNSString *UIALERTVIEW_CLICKED_KEY =@"UIAlertView_Clicked_Key";@implementation MKAlertView//代理并实现alertView代理方法- (void)handlerClickedButton:(void (^)(NSInteger btnIndex))alertBlock{ self.delegate =self; objc_setAssociatedObject(self, &UIALERTVIEW_CLICKED_KEY, alertBlock,OBJC_ASSOCIATION_COPY);}- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{ void (^block)(NSInteger btnIndex) =objc_getAssociatedObject(self, &UIALERTVIEW_CLICKED_KEY); if (block) block(buttonIndex);}@end
0 0
- iOS 中 Block实现UIAlertView
- 二十三 ,iOS UIAlertView使用block来实现代理方法;
- iOS中设计一个Block代码执行的UIAlertView
- iOS在UIAlertView中实现UIProgress进度条
- 关于ios 中 UIAlertView
- iOS开发之用block来实现UIAlertView点击事件的代理方法
- UIAlertView + Block
- 利用runtime实现UIAlertView的block回调
- UIAlertView中加入UITextField及Username/Password彈跳視窗 分类: iOS UIAlertView 代码实现
- IOS 实现UIAlertView弹出动画
- iOS中“函数式”UIAlertView
- iOS中UIAlertView的使用方法
- iOS中block实现的探究
- iOS中block实现的探究
- iOS中block实现的探究
- iOS中block实现的探究
- iOS中block实现的探究
- iOS中block实现的探究
- [LeetCode] Delete Node in a Linked List
- 安卓巴士Android开发神贴整理
- App UI设计:“看得见”有多重要
- iOS开发UI篇—UITableview控件基本使用
- 关于String对象不可变的问题分析
- iOS 中 Block实现UIAlertView
- Intersection of Two Linked Lists
- php命名空间
- 双色球
- 中介者模式
- C++ STL,ATL,WTL之间的联系和区别
- HD1002 A + B Problem II(大数简单的加法)
- ZOJ 1001 A + B Problem
- Web学习篇之---html基础知识(一)