Skip to content

Instantly share code, notes, and snippets.

[Error] TypeError: 'undefined' is not an object (evaluating 'e[0]')
n (337f27a6c3093ed3390715e341936bf3aeca7631.js, line 11)
replace (337f27a6c3093ed3390715e341936bf3aeca7631.js, line 12)
i (337f27a6c3093ed3390715e341936bf3aeca7631.js, line 12)
+ (instancetype)newTempMainContext
{
NSManagedObjectContext *parentContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType];
[parentContext performBlockAndWait:^{
[parentContext setPersistentStoreCoordinator:[NSPersistentStoreCoordinator defaultStoreCoordinator]];
}];
NSManagedObjectContext *tempContext = [NSManagedObjectContext newMainQueueContext];
[tempContext setParentContext:parentContext];
return tempContext;
@implementation UIWindow (FirstResponder)
- (BOOL)canBecomeFirstResponder {
return YES;
}
@end
@ribeto
ribeto / week-days
Created November 24, 2012 23:50
Printing out the days of the week
- (void)printOut {
NSArray *days = @[@"Sunday", @"Monday", @"Tuesday", @"Wednesday", @"Thursday", @"Friday", @"Saturday"];
for( NSString *day in days ) {
NSLog(@"day = %@",day);
}
}