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 <BugSense-iOS/BugSenseCrashController.h> | |
- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
//... | |
NSDictionary *myCustomData = [NSDictionary dictionaryWithObjectsAndKeys:@"myObject", @"myKey", nil]; | |
BugSenseCrashController *crash = | |
[BugSenseCrashController sharedInstanceWithBugSenseAPIKey:@"<Your BugSense API Key>" | |
userDictionary:myCustomData | |
sendImmediately: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
git checkout --orphan temp_master | |
git rm -rf . | |
git commit --allow-empty -m 'Make initial root commit' | |
git rebase --onto temp_master --root master | |
git branch -D temp_master |
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
git clean -xfd | |
git submodule foreach --recursive git clean -xfd | |
git reset --hard | |
git submodule foreach --recursive git reset --hard | |
git submodule update --init --recursive |
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
static void * const kKVOContext = (void *)&kKVOContext; | |
@implementation Class | |
- (void)someMethod { | |
[super someMethod]; | |
[observedObject addObserver:self | |
forKeyPath:@"keyPath" | |
options:NSKeyValueObservingOptionInitial | |
context:kKVOContext]; |
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 "Kiwi.h" | |
static NSTimeInterval const kAsynchronousTestingTimeout = 2.0; | |
SPEC_BEGIN(KlassSpec) | |
describe(@"An object", ^{ | |
context(@"when...", ^{ | |
__block Klass *object = nil; | |
beforeAll(^{ // or 'beforeEach', depending on your needs |
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
// external constants (defined in AAAKlass.m) | |
extern const CGFloat AAKlassVerticalMargin; | |
extern NSString * const AAAKlassIdentifier; |
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)initializeCoreDataStack | |
{ | |
// Some error checking is necessary... | |
NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"ProjectName" withExtension:@"momd"]; | |
NSManagedObjectModel *managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL]; | |
NSPersistentStoreCoordinator *persistentStoreCoordinator = | |
[[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:managedObjectModel]; |
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
NSManagedObjectContext *managedObjectContext = ...; | |
NSFetchRequest *fetchRequest = ...; | |
NSError *error = nil; | |
NSArray *results = [managedObjectContext executeFetchRequest:request error:&error]; | |
if (error) { | |
NSLog(@"Error: %@\n%@", [error localizedDescription], [error userInfo]); | |
return; | |
} |
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
NSManagedObjectContext *managedObjectContext = ...; | |
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; | |
[fetchRequest setEntity:[NSEntityDescription entityForName:@"Entity" inManagedObjectContext:managedObjectContext]]; | |
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"..."]; | |
[fetchRequest setPredicate:predicate]; | |
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"key" ascending:YES]; | |
[fetchRequest setSortDescriptors:@[sortDescriptor]]; |
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
NSManagedObjectModel *managedObjectModel = ...; | |
NSFetchRequest *fetchRequest = [managedObjectModel fetchRequestTemplateForName:@"Fetch Request Name"]; |
OlderNewer