// iOS, Xcode 8.3.2 stock, ARM, release build
// BOOL
char -[MYObject boolProp](void * self, void * _cmd) {
r0 = sign_extend_32(self->_boolProp);
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
// Cancel network requests | |
// Delete all managed objects | |
NSBlockOperation *operation = [NSBlockOperation blockOperationWithBlock:^{ | |
NSManagedObjectContext *managedObjectContext = [RKManagedObjectStore defaultStore].persistentStoreManagedObjectContext; | |
[managedObjectContext performBlockAndWait:^{ | |
NSError *error = nil; | |
for (NSEntityDescription *entity in [RKManagedObjectStore defaultStore].managedObjectModel) { | |
NSFetchRequest *fetchRequest = [NSFetchRequest new]; | |
[fetchRequest setEntity:entity]; | |
[fetchRequest setIncludesSubentities:NO]; |
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
#define kDebugMomentCount 10 | |
-(void)doDebugStuff { | |
[[TRSyncManager sharedSyncManager] suspendWithKey:@"DebugSuspension"]; | |
Trip *trip = [Trip findFirst]; // Get one somehow. withID is another good candidate | |
if(!trip) return; | |
double delayInSeconds = 1.0; // Wait for some assets to get tracked. | |
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); | |
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ | |
NSArray *assetURLs = [[[TRAssetsLibraryTracker shared] sortedAssets] subarrayWithRange:NSMakeRange(0, kDebugMomentCount)]; |
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
/** Public, and safe since UIKit is single-threaded */ | |
+(instancetype)controllerWithParam:(id)param0 { | |
nextParam0 = param0; | |
id vc = [[UIStoryboard storyboard…] instantiateViewController…]; | |
return vc; | |
} | |
static id nextParam0; | |
-(id)initWithCoder:(NSCoder *)aDecoder { | |
self = [super initWithCoder:aDecoder]; | |
if(!self) return nil; |
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
@implementation UINavigationController(Trim) | |
-(void)trimNavigationStack { | |
NSArray *vcs = [self.viewControllers subArrayWithRange:NSMakeRange(0,self.viewControllers.count - 1)]; | |
NSString *file = [NSTemporaryDirectory() stringByAppendingPathComponent:@"trimmedVCs"]; | |
[NSKeyedArchiver archiveRootObject:vcs toFile:file]; | |
[self setViewControllers:@[self.viewControllers.lastObject] animated:NO]; | |
} | |
-(void)untrimNavigationStack { |
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
Pod::Spec.new do |s| | |
s.name = "ReactiveCocoa" | |
s.version = "3.0-dev" | |
s.summary = "A framework for composing and transforming streams of values." | |
s.homepage = "https://github.com/blog/1107-reactivecocoa-is-now-open-source" | |
s.author = { "Josh Abernathy" => "[email protected]" } | |
s.source = { :git => "https://github.com/ReactiveCocoa/ReactiveCocoa.git", :branch => "3.0-development" } | |
s.license = 'MIT' | |
s.description = "ReactiveCocoa (RAC) is an Objective-C framework for Functional Reactive Programming. It provides APIs for composing and transforming streams of values." | |
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
/** | |
Abstract: An operation the apply an FRC update to a table view/collection view. | |
*/ | |
import UIKit | |
struct CollectionUpdate { | |
// Note: These properties are listed in the order changes should be processed |
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
// | |
// LockingTests.swift | |
// LockingTests | |
// | |
// Created by Adlai Holler on 1/18/16. | |
// Copyright © 2016 Adlai Holler. All rights reserved. | |
// | |
/** | |
Results in iOS 9.2 simulator (iPhone 6) on my iMac: | |
'-[LockingTests.LockingTests testDispatchSemaphore]' measured [Time, seconds] average: 1.012, relative standard deviation: 6.997%, values: [1.090330, 1.071983, 1.048037, 0.911319, 1.042073, 0.920707, 1.079228, 0.962281, 0.919077, 1.076169], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100 |
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
/** | |
* XCTest extensions for CGGeometry. | |
* | |
* Prefer these to XCTAssert(CGRectEqualToRect(...)) because you get output | |
* that tells you what went wrong. | |
* Could use NSValue, but using strings makes the description messages shorter. | |
*/ | |
#import <XCTest/XCTestAssertionsImpl.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
- (void)testThatNSCacheDoesntGiveUp | |
{ | |
NSCache *cache = [[NSCache alloc] init]; | |
for (NSInteger i = 0; i < 5; i++) { | |
// Add a couple entries for good measure | |
[cache setObject:(id)kCFNull forKey:[NSUUID UUID]]; | |
[cache setObject:(id)kCFNull forKey:[NSUUID UUID]]; | |
[self expectationForNotification:UIApplicationDidReceiveMemoryWarningNotification object:nil handler:nil]; | |
NSLog(@"Awaiting memory warning…"); |
OlderNewer