Skip to content

Instantly share code, notes, and snippets.

View bobspryn's full-sized avatar
🌴
On vacation

Bob Spryn bobspryn

🌴
On vacation
View GitHub Profile
NSManagedObjectContext Queue Crashed
0 libobjc.A.dylib objc_msgSend + 9
1 CoreData _PFObjectIDFastHash64 + 104
2 CoreFoundation CFBasicHashFindBucket + 1892
3 CoreFoundation CFDictionaryGetValue + 82
4 CoreData -[NSPersistentStoreCache incrementRefCountForObjectID:] + 24
5 CoreData -[NSSQLCore managedObjectContextDidRegisterObjectsWithIDs:] + 146
6 CoreData -[NSPersistentStoreCoordinator(_NSInternalMethods) _informAffectedStoresOfInterestByChildContextInObjectsWithObjectIDs:withSelector:] + 112
7 CoreData __95-[NSManagedObjectContext(_NestedContextSupport) managedObjectContextDidRegisterObjectsWithIDs:]_block_invoke_0 + 62
8 libdispatch.dylib _dispatch_client_callout + 22
RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[self class]];
[mapping addAttributeMappingsFromDictionary:@{
@"access_token": @"accessToken",
@"access_token" : @"identifier",
@"refresh_token": @"refreshToken",
@"status.errorCode": @"errorCode",
@"status.message": @"message",
@"username": @"username",
}];
@bobspryn
bobspryn / preferredFontDescriptorWithTextStyle sizes and styles
Created December 11, 2013 01:12
Apple iOS7 sizes and traits for all UIFontTextStyle's and UIContentSizeCategory's
UIContentSizeCategoryExtraSmall
FontStyle: UICTFontTextStyleBody
Point size 14.000000
Family Name .AppleSystemUIBody
FontStyle: UICTFontTextStyleHeadline
Point size 14.000000
Family Name .AppleSystemUIHeadline
Bold
FontStyle: UICTFontTextStyleSubhead
Point size 12.000000
// in tableVC
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
JotoEventTableViewCell *sizingCell = [tableView dequeueReusableCellWithIdentifier:@"JotoEvent"];
JotoEvent *event = [self.fetchedResultsController objectAtIndexPath:indexPath];
[sizingCell updateFriendsForEvent:[event.friends allObjects]];
sizingCell.frame = CGRectMake(0, 0, self.tableView.frame.size.width, sizingCell.frame.size.height);
[sizingCell setNeedsLayout];
[sizingCell layoutIfNeeded];
static const CGFloat kLabelNegativePadding = 78;
static const CGFloat kLabelVerticalPadding = 17;
static const CGFloat kMinCellHeight = 61;
static const CGFloat kCellBorderInset = 8;
static UIFont *questionFont;
static UIFont *metaFont;
static UIFont *metaFontBold;
+ (void) setupFonts {
@bobspryn
bobspryn / response.json
Created February 9, 2014 06:30
response.json
{
"next-cursor": 1383180272378407000,
"previous-cursor": 0,
"records": [
{
"comment": "@conor #whatmonkey",
"created": "2013-11-01T23:43:54Z",
"id": 620,
"is-active": true,
"question-id": 886,
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.row == 1) {
static JotoTutorialTagsTableViewCell *sizingCell;
if (!sizingCell) {
sizingCell = [tableView dequeueReusableCellWithIdentifier:@"tutorialTagsCell"];
}
sizingCell.frame = CGRectMake(0, 0, self.tableView.frame.size.width, self.tableView.frame.size.height);
NSString *category = [self.interestArray objectAtIndex:indexPath.section];
@bobspryn
bobspryn / TCFeedViewModel.m
Created February 18, 2014 21:50
TCFeedViewModel.m
//
// TCFeedViewModel.m
// Three Cents
//
// Created by Bob Spryn on 2/17/14.
// Copyright (c) 2014 Three Cents, Inc. All rights reserved.
//
#import "TCFeedViewModel.h"
@bobspryn
bobspryn / isPhone568.h
Created February 18, 2014 22:24
isPhone568.h
#define isPhone568 ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone && [UIScreen mainScreen].bounds.size.height == 568)
#define iPhone568ImageNamed(image) (isPhone568 ? [NSString stringWithFormat:@"%@-568h.%@", [image stringByDeletingPathExtension], [image pathExtension]] : image)
#define iPhone568Image(image) ([UIImage imageNamed:iPhone568ImageNamed(image)])
@bobspryn
bobspryn / prefferedFont.m
Created February 19, 2014 02:36
prefferedFont.m
+(UIFontDescriptor *)preferredAvenirNextFontDescriptorWithTextStyle:(NSString *)style {
static dispatch_once_t onceToken;
static NSDictionary *fontSizeTable;
dispatch_once(&onceToken, ^{
fontSizeTable = @{
UIFontTextStyleHeadline: @{UIContentSizeCategoryExtraExtraExtraLarge: @(23),
UIContentSizeCategoryExtraExtraLarge: @(21),
UIContentSizeCategoryExtraLarge: @(18),
UIContentSizeCategoryLarge: @(16),
UIContentSizeCategoryMedium: @(15),