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
// | |
// main.m | |
// testproperties | |
// | |
// Created by Nicolas Bouilleaud on 15/03/12. | |
// Copyright (c) 2012 __MyCompanyName__. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#import <objc/runtime.h> |
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
// | |
// clang main.m -framework Foundation && ./a.out | |
#import <Foundation/Foundation.h> | |
/****************************************************************************/ | |
#pragma mark - | |
@interface Advertiser : NSObject | |
@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
// | |
// NSRunLoop+TimeOutAndFlag.h | |
// | |
// | |
@interface NSRunLoop (TimeOutAndFlag) | |
- (void)runUntilTimeout:(NSTimeInterval)delay orFinishedFlag:(BOOL*)finished; | |
@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
// | |
// PropertyMacros.h | |
// | |
// | |
// Created by Nicolas Bouilleaud on 12/04/12, | |
// using ideas by Uli Kusterer (http://orangejuiceliberationfront.com/safe-key-value-coding/) | |
// Laurent Deniau (https://groups.google.com/forum/?fromgroups#!topic/comp.std.c/d-6Mj5Lko_s) | |
// and Nick Forge (http://forgecode.net/2011/11/compile-time-checking-of-kvc-keys/) | |
// | |
// |
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
// | |
// clang orderedset-kvo-test.m -framework Foundation && ./a.out | |
// | |
#import <Foundation/Foundation.h> | |
#import <objc/runtime.h> | |
#import <objc/message.h> | |
int main () | |
{ |
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
// | |
// clang orderedsets-more-kvc.m -framework Foundation && ./a.out | |
// | |
#import <Foundation/Foundation.h> | |
int main () | |
{ | |
@autoreleasepool { |
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
// | |
// clang -framework Foundation NSConstantString_test.m; ./a.out; rm ./a.out | |
// | |
#import <Foundation/Foundation.h> | |
#define PrintObjectInfo(obj) \ | |
do{id _obj = ( obj );\ | |
printf("%-61s %-20s %-16p %ld\n", #obj" :", [NSStringFromClass([_obj class]) UTF8String], _obj, [_obj retainCount]);\ | |
}while(0); |
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 <Foundation/Foundation.h> | |
@interface Foo : NSObject | |
@end | |
@implementation Foo | |
- (void) setBar:(void(^)(void))block {} | |
- (void) doBaz:(void(^)(void))block{} | |
@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
/*/../bin/ls > /dev/null | |
COMPILED=${0%.*} | |
clang $0 -o $COMPILED -framework Foundation; | |
$COMPILED; rm $COMPILED; exit; | |
*/ | |
#import <Foundation/Foundation.h> | |
int main(int argc, char *argv[]) |
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
// | |
// NBResponderChainUtilities.h | |
// | |
// Created by Nicolas @ bou.io on 19/04/13. | |
// | |
#import <UIKit/UIKit.h> | |
@interface UIView (NBResponderChainUtilities) | |
- (UIView*) nb_firstResponder; // Recurse into subviews to find one that responds YES to -isFirstResponder |
OlderNewer