-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCallBack.h
More file actions
executable file
·32 lines (26 loc) · 935 Bytes
/
Copy pathCallBack.h
File metadata and controls
executable file
·32 lines (26 loc) · 935 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// ##############################################################
// CallBack.h
// Magic Number Machine
//
// Created by Matt Gallagher on Wed Apr 23 2003.
// Copyright (c) 2003 Matt Gallagher. All rights reserved.
// ##############################################################
#import <Foundation/Foundation.h>
//
// About CallBack
//
// A small class which creates an object that sends the specified message when it
// is deleted. Useful to have an action called at Autorelease pool time.
//
// Modified by Mike Griebling to use blocks -- was crashing otherwise
//
typedef id (^CallBackType)(id param);
@interface CallBack : NSObject {
id callBackObject;
CallBackType callBackMethod;
}
- (instancetype)init NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithObject:(id)object method:(CallBackType)method NS_DESIGNATED_INITIALIZER;
- (void)dealloc;
+ (instancetype)callBack:(id)object method:(CallBackType)method;
@end