文件名称:MUBlockDelegate
- 所属分类:
- IOS
- 资源属性:
- [MacOS]
- 上传时间:
- 2013-03-17
- 文件大小:
- 125kb
- 下载次数:
- 0次
- 提 供 者:
- gaofe******
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
MUBlockDelegate——一个基于Block的通用委托实现
使用了MUBlockDelegate...
不需要写委托协议,也不需要新建委托实现,你只需要新建一个BlockDelegate-MUBlockDelegate
============
1.normally, we use delegates as follows:
firstly,
@protocol TestProtcol <NSObject>
- (NSString*) testDelegateMethod:(NSString*) aString
@end
@interface TestDelegateImpl : NSObject<TestProtcol>
@end
and:
@implementation TestDelegateImpl
- (NSString*) testDelegateMethod:(NSString*)aString
{
return aString
}
@end
secondly,
#import "TestProtcol.h"
@interface TestObject : NSObject
@property(nonatomic, weak) id<TestProtcol> delegate
- (NSString*) callDelegate:(NSString*) aString
@end
@implementation TestObject
@synthesize delegate = _delegate
- (NSString*) callDelegate:(NSString*) aString
{
if ([_delegate respondsToSelector:@selector(testDelegateMethod:)]) {
return [_delegate testDelegateMethod:aString]
}
return nil
使用了MUBlockDelegate...
不需要写委托协议,也不需要新建委托实现,你只需要新建一个BlockDelegate-MUBlockDelegate
============
1.normally, we use delegates as follows:
firstly,
@protocol TestProtcol <NSObject>
- (NSString*) testDelegateMethod:(NSString*) aString
@end
@interface TestDelegateImpl : NSObject<TestProtcol>
@end
and:
@implementation TestDelegateImpl
- (NSString*) testDelegateMethod:(NSString*)aString
{
return aString
}
@end
secondly,
#import "TestProtcol.h"
@interface TestObject : NSObject
@property(nonatomic, weak) id<TestProtcol> delegate
- (NSString*) callDelegate:(NSString*) aString
@end
@implementation TestObject
@synthesize delegate = _delegate
- (NSString*) callDelegate:(NSString*) aString
{
if ([_delegate respondsToSelector:@selector(testDelegateMethod:)]) {
return [_delegate testDelegateMethod:aString]
}
return nil
(系统自动生成,下载前可以参看下载内容)
下载文件列表
MUBlockDelegate
...............\.DS_Store
__MACOSX
........\MUBlockDelegate
........\...............\._.DS_Store
MUBlockDelegate\.git
...............\....\config
...............\....\FETCH_HEAD
...............\....\HEAD
...............\....\index
...............\....\logs
...............\....\....\HEAD
...............\....\....\refs
...............\....\....\....\heads
...............\....\....\....\.....\master
...............\....\....\....\remotes
...............\....\....\....\.......\origin
...............\....\....\....\.......\......\HEAD
...............\....\objects
...............\....\.......\01
...............\....\.......\..\81bcc0a7ef6e8532f1775b97b8389b113fabdd
...............\....\.......\02
...............\....\.......\..\37597b848a1890bb30ba0ff4102f8107cafdcb
...............\....\.......\03
...............\....\.......\..\bef2b2e1a522bbc63d1cc1be44cce60282f6c3
...............\....\.......\0a
...............\....\.......\..\7c993be98ff56c189afce5ae612a8a6216e39c
...............\....\.......\0b
...............\....\.......\..\5fbee6045956307f79863131c04bfe8d64090c
...............\....\.......\0e
...............\....\.......\..\3ed8e041259b5b47474d384f58ad7af20673ac
...............\....\.......\10
...............\....\.......\..\fa68477fdff21a32c45f7f8cad41f99995f0e3
...............\....\.......\11
...............\....\.......\..\bd6015f163fd540cbac922b4c05da2b3966102
...............\....\.......\13
...............\....\.......\..\cbd6176dfaedcc5f31f615b103dba11b84a4a5
...............\....\.......\14
...............\....\.......\..\0bfbca949d06b98f51f156a50ed798117ceb74
...............\....\.......\15
...............\....\.......\..\a696ef53b2feb0afeac3e892715a8441721665
...............\....\.......\1b
...............\....\.......\..\0e52c8c6254674b3ef96e56c1191898056d93d
...............\....\.......\..\acf64ff97a6323436212c7366a6ed27cb7db12
...............\....\.......\25
...............\....\.......\..\a09708c166139bb9f816d03227729127aa629b
...............\....\.......\28
...............\....\.......\..\ff5e90b310fd6027d33fd6bdb77d8fc8e8ef0d
...............\....\.......\2f
...............\....\.......\..\a2c7af777e499dfc444f1b9bf50a201f4d25db
...............\....\.......\31
...............\....\.......\..\fe5926fd50aad0dffd807cae89362fb10b4dda
...............\....\.......\34
...............\....\.......\..\52aff9e45a5a566e20a8705729c746003126bd
...............\....\.......\3b
...............\....\.......\..\b06a53ea20fe8bede47318d41a6b78f90913e6
...............\....\.......\3c
...............\....\.......\..\5c4ecd8d30ee5275120c3cc5c46f0d67f6ad69
...............\....\.......\..\6d5aff149aac706db5d0b382e85192f091c84d
...............\....\.......\3d
...............\....\.......\..\bce43b9b1ff7d020583c2c3cc5cf2041bd1a24
...............\....\.......\47
...............\....\.......\..\7b28ff8f86a3158a71c4934fbd3a2456717d7a
...............\....\.......\4e
...............\....\.......\..\64f1601596fa555cd381e3be99635a516006e9
...............\....\.......\..\f7ec1625c46deec1402ab740c5dc2a4f140e2d
...............\....\.......\53
...............\....\.......\..\a30632036c07fbdeed3240de6e03e9a5d2f842
...............\....\.......\56
...............\....\.......\..\0306d5c80fe0b74716e01f7f55b98a83c1de3e
...............\....\.......\57
...............\....\.......\..\5abd41a5f563c91b1ef04c1eeb0ca8d3a29407
...............\....\.......\..\657554c27cb39b7b40299b81d1e9e24c2ffc07
...............\....\.......\62
...............\....\.......\..\797e35e6bacfed8dfe719178d64c48f88cfb33
...............\....\.......\64
...............\....\.......\..\3e1d8754e37ddeb0c563bad08a4f5f5d06e392
...............\....\.......\6b
...............\....\.......\..\c95e82fb8f63fb1d248a992ab93ebf6b6298a6
...............\....\.......\6c
...............\....\.......\..\7f6ce8e619f0e3325794e423d916f3084409cf
...............\....\.......\6d
...............\....\.......\..\e3b30ef952d48a6230c3ba0125fd66ec30cf60
...............\....\.......\6e
...............\....\.......\..\9e15f06d2fd10fca06b7272584540bc71a1183
...............\....\.......\70
..