forked from phildow/Journler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJournlerMainThreadProxy.h
56 lines (38 loc) · 1.67 KB
/
JournlerMainThreadProxy.h
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* =============================================================================
FILE: UKMainThreadProxy.h
PROJECT: UKMainThreadProxy
PURPOSE: Send a message to object theObject to [theObject mainThreadProxy]
instead and the message will be received on the main thread by
theObject.
COPYRIGHT: (c) 2004 M. Uli Kusterer, all rights reserved.
AUTHORS: M. Uli Kusterer - UK
LICENSES: MIT License
REVISIONS:
2006-03-13 UK Clarified license.
2004-10-14 UK Created.
========================================================================== */
// -----------------------------------------------------------------------------
// Headers:
// -----------------------------------------------------------------------------
#import <Cocoa/Cocoa.h>
// -----------------------------------------------------------------------------
// Categories:
// -----------------------------------------------------------------------------
@interface NSObject (JournlerMainThreadProxy)
-(id) mainThreadProxy; // You can't init or release this object.
-(id) copyMainThreadProxy; // Gives you a retained version.
@end
// -----------------------------------------------------------------------------
// Classes:
// -----------------------------------------------------------------------------
/*
This object is created as a proxy in a second thread for an existing object.
All messages you send to this object will automatically be sent to the other
object on the main thread, except NSObject methods like retain/release etc.
*/
@interface JournlerMainThreadProxy : NSObject
{
IBOutlet id target;
}
-(id) initWithTarget: (id)targ;
@end