build-lists: true autoscale: true
#Advanced Arduino ###(or Arduino and iOS)
####Andrew Madsen ####CocoaHeads SLC - May 5, 2015
#!/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; |
#import <Foundation/Foundation.h> | |
@interface MyClass : NSObject | |
{ | |
id varA; | |
} | |
@property (nonatomic, strong) id varA; | |
@end |
#import <Foundation/Foundation.h> | |
#import <objc/runtime.h> | |
@protocol TestProtocol <NSObject> | |
@required | |
- (void)methodA; | |
@optional | |
- (void)methodB; | |
@end |
#import <Foundation/Foundation.h> | |
@interface Foo : NSObject | |
@property (nonatomic, strong) NSArray *bars; | |
- (void)addBar:(NSString *)bar; | |
- (void)removeBar:(NSString *)bar; | |
@end |
NSData *ORSDecryptDataWithPublicKey(NSData *dataToDecrypt, SecKeyRef publicKey) | |
{ | |
const CSSM_KEY *cssmPubKey = NULL; | |
SecKeyGetCSSMKey(publicKey, &cssmPubKey); | |
CSSM_CSP_HANDLE handle; | |
SecKeyGetCSPHandle(publicKey, &handle); | |
CSSM_DATA inputData = { | |
.Data = (uint8_t *)[dataToDecrypt bytes], | |
.Length = [dataToDecrypt length], |
/* Compile and run with: | |
$> clang responds.m -ObjC -std=c99 -framework Foundation | |
$> ./a.out | |
*/ | |
#import <Foundation/Foundation.h> | |
@interface Foo : NSObject | |
- (int)bar; | |
@end |
- (void)drawRect:(CGRect)rect | |
{ | |
[super drawRect:rect]; | |
UIColor *color = [UIColor colorWithWhite:1.0 alpha:0.2]; | |
[color setFill]; | |
[color setStroke]; | |
// Draw stripe on right | |
CGRect sideLineRect = CGRectMake(CGRectGetMidX(self.marker.frame) - 1.5, |
git submodule add https://github.com/AFNetworking/AFNetworking.git External/AFNetworking | |
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.timeapi.org/utc/now"]]; | |
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; | |
operation.responseSerializer = [AFHTTPResponseSerializer serializer]; | |
[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, NSData *responseObject) { | |
NSString *response = [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding]; | |
NSLog(@"response: %@", response); |
+ (NSArray *)allTheFakePeople { | |
return @[ | |
@{imageNameKey: @"1", | |
nameKey: @"Some Dude", | |
phoneNumberKey: @"888-888-8888", | |
jobKey: @"Garbage Collection"}, | |
@{imageNameKey: @"2", | |
nameKey: @"Chris Sacca", | |
phoneNumberKey: @"920-558-1033", |