View FunctionPointerFromMethod.m
// To compile and test this from the command line: | |
// | |
// $> clang FunctionPointerFromMethod.m -ObjC -framework Foundation -fobjc-arc | |
// $> ./a.out | |
#import <Foundation/Foundation.h> | |
@interface MyClass : NSObject | |
- (void)someMethodThatTakesOneStringArgument:(NSString *)string; | |
@end |
View MethodInProtocolsRequiredExample.m
#import <Foundation/Foundation.h> | |
#import <objc/runtime.h> | |
@protocol TestProtocol <NSObject> | |
@required | |
- (void)methodA; | |
@optional | |
- (void)methodB; | |
@end |
View gist:4478942
#import <Foundation/Foundation.h> | |
@interface MyClass : NSObject | |
{ | |
id varA; | |
} | |
@property (nonatomic, strong) id varA; | |
@end |
View BuildLibFLAC.sh
#!/usr/bin/env bash | |
# Put this script in the libFLAC source directory, and make sure it's executable (chmod +x BuildLibFlac.sh), then run it (./BuildLibFLAC.sh) | |
# Note that this was written to be used on 10.8 with Xcode 4.6 and FLAC 1.2.1. It may/will need to be changed for future versions of the OS, tools, and/or FLAC | |
env CFLAGS="-arch x86_64" CPPFLAGS="-arch x86_64" LDFLAGS="-arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.5" ./configure --disable-asm-optimizations --enable-static --disable-shared --disable-ogg | |
make clean; make | |
cp src/libFLAC/.libs/libFLAC.a ./libFLAC64.a | |
make clean; |
View LabelDimensions.csv
labelTypeName | labelSheetWidth | labelSheetHeight | topMargin | bottomMargin | leftMargin | rightMargin | numberOfRows | numberOfColumns | horizontalGutter | verticalGutter | |
---|---|---|---|---|---|---|---|---|---|---|---|
Avery 2160 Bottom | 8.5 | 11 | 5.5 | 0.5 | 0.81 | 0.81 | 4 | 1 | 0 | 0 | |
Avery 2160 Top | 8.5 | 11 | 0.5 | 5.5 | 0.81 | 0.81 | 4 | 1 | 0 | 0 | |
Avery 2162 Bottom | 8.5 | 11 | 5.5 | 0.5 | 0.125 | 0.125 | 3 | 1 | 0 | 0 | |
Avery 2162 Top | 8.5 | 11 | 0.5 | 5.5 | 0.125 | 0.125 | 3 | 1 | 0 | 0 | |
Avery 2163 Bottom | 8.5 | 11 | 5.5 | 0.5 | 0.125 | 0.125 | 2 | 1 | 0 | 0 | |
Avery 2163 Top | 8.5 | 11 | 0.5 | 5.5 | 0.125 | 0.125 | 2 | 1 | 0 | 0 | |
Avery 2164 Bottom | 8.5 | 11 | 5.844 | 0.844 | 0.125 | 0.125 | 1 | 1 | 0 | 0 | |
Avery 2164 Top | 8.5 | 11 | 0.844 | 5.844 | 0.125 | 0.125 | 1 | 1 | 0 | 0 | |
Avery 5159 | 8.5 | 11 | 0.25 | 0.25 | 0.156 | 0.156 | 7 | 2 | 0.188 | 0 |
View ORSSerialPort+Attributes.m
#import <Foundation/Foundation.h> | |
#import <IOKit/usb/USBSpec.h> | |
#import "ORSSerialPort.h" | |
@interface ORSSerialPort (Attributes) | |
@property (nonatomic, readonly) NSDictionary *ioDeviceAttributes; | |
@property (nonatomic, readonly) NSNumber *vendorID; | |
@property (nonatomic, readonly) NSNumber *productID; |
View CategoryPropertyDemo.m
#import <Foundation/Foundation.h> | |
@interface MyClass : NSObject | |
@end | |
@implementation MyClass | |
@end | |
@interface MyClass (Properties) |
View Reusable.m
- (void)makeGraphPopup:(NSString *)popupName { | |
/* | |
I want to pass a string (popupName) into this method and use it dynamically | |
for object names just like popupName.to_sym in Ruby. | |
Below you can see where I've insert {popupName} and how it would append itself | |
to various object names which are IBOutlets | |
*/ | |
View SeparateNSLocks.m
#import <Foundation/Foundation.h> | |
@interface Test : NSObject | |
- (void)enqueue:(id)object; | |
- (id)dequeue; | |
@end | |
@implementation Test |
View MultipleClassExtensions.m
#import <Foundation/Foundation.h> | |
@interface TestClass : NSObject | |
@end | |
@interface TestClass () | |
@property NSString *name; |
OlderNewer