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
// Missing 'result unused' warning demo | |
// Correct: expect.beNil(); | |
// Wrong: expect.beNil; | |
#import <Foundation/NSObject.h> | |
#define expect [EXPExpect new] | |
@interface EXPExpect : NSObject | |
- (void(^)(void)) beNil; |
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
// | |
// YFObjCUtils.c | |
// | |
// Created by Adam Kaplan on 7/31/15. | |
// Licensed under the MIT license. | |
// | |
@implementation UsageExample | |
- (void)usageMethod { |
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
{ | |
uint64_t t_start = mach_absolute_time(); | |
<#code#> | |
uint64_t t_end = mach_absolute_time(); | |
struct mach_timebase_info t_info; | |
mach_timebase_info(&t_info); | |
double_t elapsed = (t_end - t_start) * t_info.numer / (t_info.denom * (double_t)1e6); | |
NSLog(@"Elapsed: %fms", elapsed); | |
} |
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
- (AFHTTPRequestOperation *)GET:(NSString *)urlString | |
parameters:(NSDictionary *)parameters | |
success:(void (^)(AFHTTPRequestOperation*,id))success | |
failure:(void (^)(AFHTTPRequestOperation*,NSError*))failure | |
{ | |
NSCAssert([NSThread isMainThread], @"must execute on the main thread"); | |
NSURL *url = [[NSURL URLWithString:urlString relativeToURL:self.baseURL] absoluteString]; | |
NSMutableURLRequest *request = [self.requestSerializer requestWithMethod:@"GET" |
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
#pragma clang diagnostic push | |
#pragma clang diagnostic ignored "-Wdeprecated-declarations" | |
if (config->queuePointer && config->queuePointer == dispatch_get_current_queue()) { | |
#pragma clang diagnostic pop |
NewerOlder