mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Fix to include config.h in all cases
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13490 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
45ebb23d43
commit
df34be2951
3 changed files with 49 additions and 8 deletions
|
@ -28,11 +28,17 @@ id foo = @"NotificationTestFoo";
|
|||
|
||||
int main ()
|
||||
{
|
||||
id o1 = [NSObject new];
|
||||
id observer1 = [Observer new];
|
||||
id o1;
|
||||
id observer1;
|
||||
id arp;
|
||||
|
||||
arp = [NSAutoreleasePool new];
|
||||
NSLog(@"Make string object");
|
||||
o1 = [NSString new];
|
||||
NSLog(@"Make Observer object");
|
||||
observer1 = [Observer new];
|
||||
|
||||
NSLog(@"Add observer to process centre");
|
||||
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
addObserver: observer1
|
||||
|
@ -40,24 +46,54 @@ int main ()
|
|||
name: foo
|
||||
object: o1];
|
||||
|
||||
NSLog(@"Add observer to distributed centre");
|
||||
[[NSDistributedNotificationCenter defaultCenter]
|
||||
addObserver: observer1
|
||||
selector: @selector(gotNotificationFoo:)
|
||||
name: foo
|
||||
object: o1];
|
||||
|
||||
NSLog(@"Add observer to process centre");
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
addObserver: observer1
|
||||
selector: @selector(gotNotificationFooNoObject:)
|
||||
name: foo
|
||||
object: nil];
|
||||
|
||||
NSLog(@"Add observer to distributed centre");
|
||||
[[NSDistributedNotificationCenter defaultCenter]
|
||||
addObserver: observer1
|
||||
selector: @selector(gotNotificationFooNoObject:)
|
||||
name: foo
|
||||
object: nil];
|
||||
|
||||
|
||||
NSLog(@"Post to process centre");
|
||||
/* This will cause two messages to be printed, one for each request above. */
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
postNotificationName: foo
|
||||
object: o1];
|
||||
|
||||
NSLog(@"Post to distributed centre");
|
||||
/* This will cause two messages to be printed, one for each request above. */
|
||||
[[NSDistributedNotificationCenter defaultCenter]
|
||||
postNotificationName: foo
|
||||
object: o1];
|
||||
|
||||
NSLog(@"Post to process centre");
|
||||
/* This will cause one message to be printed. */
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
postNotificationName: foo
|
||||
object: nil];
|
||||
|
||||
NSLog(@"Post to distributed centre");
|
||||
/* This will cause one message to be printed. */
|
||||
[[NSDistributedNotificationCenter defaultCenter]
|
||||
postNotificationName: foo
|
||||
object: nil];
|
||||
|
||||
|
||||
NSLog(@"Remove observer from process centre");
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
removeObserver: observer1
|
||||
name: nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue