This repository has been archived by the owner on May 21, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added correct removeObserver API that had been missing in a while (I …
…am a bad bad bad dev) Fixed unit tests. Removed useless UI target. Added command line tester tool. Some other code reorgs. --HG-- rename : CKVOBlockNotificationCenter.h => NSObject_KVOBlockNotificationExtensions.h rename : CKVOBlockNotificationCenter.m => NSObject_KVOBlockNotificationExtensions.m rename : Test/Unit Tests-Info.plist => Test/Unit Tests/Unit Tests-Info.plist rename : Unit Tests/UnitTests.h => Test/Unit Tests/UnitTests.h
- Loading branch information
Showing
16 changed files
with
226 additions
and
4,418 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// CTester.h | ||
// Test | ||
// | ||
// Created by Jonathan Wight on 06/30/10. | ||
// Copyright 2010 toxicsoftware.com. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@interface CTester : NSObject { | ||
NSString *testValue; | ||
} | ||
|
||
@property (readwrite, nonatomic, retain) NSString *testValue; | ||
|
||
- (void)test; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// CTester.m | ||
// Test | ||
// | ||
// Created by Jonathan Wight on 06/30/10. | ||
// Copyright 2010 toxicsoftware.com. All rights reserved. | ||
// | ||
|
||
#import "CTester.h" | ||
|
||
#import "CKVOBlockNotificationCenter.h" | ||
|
||
@implementation CTester | ||
|
||
@synthesize testValue; | ||
|
||
- (void)test | ||
{ | ||
__block NSString *theValue = NULL; | ||
KVOBlock theBlock = ^(NSString *keyPath, id object, NSDictionary *change, id identifier) { | ||
theValue = [change objectForKey:@"new"]; | ||
}; | ||
|
||
[self addObserver:self handler:theBlock forKeyPath:@"testValue" options:NSKeyValueObservingOptionNew identifier:@"FOO"]; | ||
|
||
NSLog(@"%@", theValue); | ||
self.testValue = @"New Value"; | ||
NSLog(@"%@", theValue); | ||
|
||
[self removeObserver:self forKeyPath:@"testValue" identifier:@"FOO"]; | ||
} | ||
|
||
@end |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.