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
int main(int argc, char **argv) | |
{ | |
return 0; | |
} | |
#import <Foundation/Foundation.h> | |
@interface Foo : NSObject | |
-(id)newFoo; | |
@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
#include <Foundation/Foundation.h> | |
@interface BusyWaiter : NSObject | |
{ | |
BOOL _done; | |
} | |
- (void)markDone; | |
- (BOOL)isDone; | |
@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
shelve () { | |
local filename=${1:-shelf.patch} | |
if [[ -a $filename ]]; then | |
echo 1>&2 shelve: file "'$filename'" already exists | |
return 256 | |
fi | |
svn diff | tee $filename | wc -l | read linecount && svn revert -R . | |
if [[ $linecount -eq 0 ]]; then |
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> | |
class CppClass | |
{ | |
public: | |
void doIt(); | |
} | |
; | |
@interface Foo : NSObject |
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
OQLinearRGBA OQGetColorComponents(NSColor *c) | |
{ | |
static dispatch_once_t once; | |
static NSColorSpace *linearRGBColorSpace; | |
dispatch_once(&once, ^{ | |
CGColorSpaceRef cgColorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGBLinear); | |
linearRGBColorSpace = [[NSColorSpace alloc] initWithCGColorSpace:cgColorSpace]; | |
CGColorSpaceRelease(cgColorSpace); | |
OBASSERT_NOTNULL(linearRGBColorSpace); |
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> | |
@protocol Foo | |
@property (readonly, nonatomic) int blah; | |
@end | |
typedef void (^bk)(void); | |
@interface Foo : NSObject<Foo> | |
{ int v; } | |
- (bk)makeBlock:(id<Foo>)otherFoo; |
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 | |
{ /* Notice there's nothing here */ } | |
@property(nonatomic,retain) id someVar; | |
- (void)unrelated; | |
@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
// It would be great if we had a typeof analogue that worked for selectors and evaluated to the type of the method that matches that selector. | |
@interface Foo : NSObject | |
- (NSString *)aMethod:(CGFloat)arg1 withArgs:(NSString *)arg2; | |
@end | |
void exampleOne() { | |
Foo *f = [Foo new]; | |
NSString *s = (__typeof_msg__(f, @selector(aMethod:withArgs:))objc_msgSend)(f, 0, @"String"); | |
NSNumber *n = (__typeof_msg__(f, @selector(aMethod:withArgs:))objc_msgSend)(f, 1.0, @"Hi"); // error: returns NSString* |
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
Sampling process 363 for 3 seconds with 1 millisecond of run time between samples | |
Sampling completed, processing symbols... | |
Analysis of sampling Xcode (pid 363) every 1 millisecond | |
Process: Xcode [363] | |
Path: /Xcode4/Applications/Xcode.app/Contents/MacOS/Xcode | |
Load Address: 0x100000000 | |
Identifier: com.apple.dt.Xcode | |
Version: 4.0.1 (99) | |
Build Info: IDEApplication-990000~49 | |
Code Type: X86-64 (Native) |
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/NSObject.h> | |
@interface Foo : NSObject | |
@property (readonly, assign) id bar; | |
@end | |
@interface Foo (Internal) |
OlderNewer