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
class Bar : NSObject | |
{ | |
var ref : (()->Bool)? | |
deinit { println("Bye from bar!") } | |
} | |
class Foo : NSObject | |
{ | |
var bar : Bar | |
override init() |
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
#import <objc/runtime.h> | |
@interface TestObject : NSObject | |
@property (nonatomic, strong) NSString *aString; | |
@property (nonatomic, assign) int aNumber; | |
@property (nonatomic, strong) NSArray *anArray; | |
@property (nonatomic, strong) NSDictionary *aDict; | |
@property (nonatomic, strong) TestObject *childObject; | |
@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
- (void)setProperties:(NSDictionary *)keyToPropertyDictionary fromDictionary:(NSDictionary *)properties | |
{ | |
for (id key in [keyToPropertyDictionary keyEnumerator]) | |
{ | |
id value = properties[key]; | |
if (!value) continue; | |
value = [NSNull null] == value ? nil : value; | |
id realKey = keyToPropertyDictionary[key]; | |
NSError *error = nil; | |
if (![self validateValue:&value forKey:realKey error:&error]) |
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
extension GameCenter | |
{ | |
struct NotificationKey | |
{ | |
static let Error = "error" | |
static let Achievement = "achievement" | |
} | |
struct Notification | |
{ |
NewerOlder