Skip to content

Instantly share code, notes, and snippets.

class Controller {
var defaultDate: NSDate { return NSDate() }
var currentDate: NSDate
func init() {
currentDate = defaultDate // causes error, because self doesn't exist yet
super.init()
}
}
#0 0x000000010d08db8a in objc_exception_throw ()
#1 0x000000010d455e6d in +[NSException raise:format:] ()
#2 0x00000001094c2284 in -[PFOfflineStore updateObjectIdForObject:oldObjectId:newObjectId:] at /Users/nlutsenko/src/parse/ios-client/Parse/Internal/PFOfflineStore.m:989
#3 0x00000001094d22cf in -[PFObject setObjectId:] at /Users/nlutsenko/src/parse/ios-client/Parse/PFObject.m:1815
#4 0x00000001095230fc in __28-[PFInstallation saveAsync:]_block_invoke at /Users/nlutsenko/src/parse/ios-client/Parse/PFInstallation.m:361
#5 0x0000000109493b28 in __41-[BFTask continueWithExecutor:withBlock:]_block_invoke_2 at /Users/chrisp/src/build-sdk/Bolts-IOS/Bolts/Common/BFTask.m:287
#6 0x000000010dd52ba6 in _dispatch_call_block_and_release ()
#7 0x000000010dd707f4 in _dispatch_client_callout ()
#8 0x000000010dd5b15d in _dispatch_root_queue_drain ()
#9 0x000000010dd5c5d9 in _dispatch_worker_thread3 ()
#0 0x000000010e0e3755 in _os_lock_handoff_trylock ()
#1 0x000000010d0a21e4 in objc_object::sidetable_release(bool) ()
#2 0x00000001094930d5 in -[BFTask trySetResult:] at /Users/chrisp/src/build-sdk/Bolts-IOS/Bolts/Common/BFTask.m:171
#3 0x0000000109492ff7 in -[BFTask setResult:] at /Users/chrisp/src/build-sdk/Bolts-IOS/Bolts/Common/BFTask.m:157
#4 0x000000010948d12e in -[BFTaskCompletionSource setResult:] at /Users/chrisp/src/build-sdk/Bolts-IOS/Bolts/Common/BFTaskCompletionSource.m:48
#5 0x0000000109493d6e in __41-[BFTask continueWithExecutor:withBlock:]_block_invoke_3 at /Users/chrisp/src/build-sdk/Bolts-IOS/Bolts/Common/BFTask.m:301
#6 0x0000000109493b28 in __41-[BFTask continueWithExecutor:withBlock:]_block_invoke_2 at /Users/chrisp/src/build-sdk/Bolts-IOS/Bolts/Common/BFTask.m:287
#7 0x00000001094948d7 in __29+[BFExecutor defaultExecutor]_block_invoke_2 at /Users/chrisp/src/build-sdk/Bolts-IOS/Bolts/Common/BFExecutor.m:43
#8 0x0000000109494d39 in -[BFExecutor execute:] at /Users/chrisp/src/build-sdk/Bolt
public extension NSDate {
var calendarComponents: NSDateComponents {
get {
//let componentFlags: NSCalendarUnit = NSCalendarUnit(CalendarUnitEra)
let componentFlags = NSCalendarUnit(UInt.max)
return NSDate.currentCalendar().components(componentFlags, fromDate:self)
}
}
//
// MainControllerTests.swift
// Inhale
//
// Created by Michael Eisel on 1/7/15.
// Copyright (c) 2015 Fredrik Krafft. All rights reserved.
//
import XCTest
// HOW TO USE:
// This makes debugging auto-layout easier by telling you the variable names of the views in your constraints
// Search for "hasPrefix:" in this file and fill in the prefix for your app
// FYI: in order to do this, it swizzles -description and -debugDescription of NSLayoutConstraint in a +load method when you start the app
#import <UIKit/UIKit.h>
#import <objc/runtime.h>
@interface UIView (SCIvars)
#!/usr/bin/ruby
raise "Usage: ./args.rb <path to executable>" unless ARGV.size == 1
new_seg_name = "__MY_TEXT"
binary = ARGV.first
sect_regex = /\s*Section (\S+)/
sects = `xcrun size -x -l -m #{binary}`.split("\n").drop_while do |line|
These are just common sets of args. For your app, it may vary. But these should cover most of the size of the __TEXT segment
For an app with just Objective-C:
-Wl,-rename_section,__TEXT,__text,__MY_TEXT,__text
-Wl,-rename_section,__TEXT,__stubs,__MY_TEXT,__stubs
-Wl,-rename_section,__TEXT,__stub_helper,__MY_TEXT,__stub_helper
-Wl,-rename_section,__TEXT,__objc_classname,__MY_TEXT,__objc_classname
-Wl,-rename_section,__TEXT,__cstring,__MY_TEXT,__cstring
-Wl,-rename_section,__TEXT,__objc_methname,__MY_TEXT,__objc_methname
#!/usr/bin/ruby
=begin
#### DIRECTIONS ####
Run `/usr/bin/ruby savings.rb <path to executable>`, and it will report the estimated savings for that executable.
*However*, the executable cannot have been downloaded from the app store (or else it will already be the encrypted version, and we can't unencrypt it to calculate the savings)
Also, it should be a binary for a specific architecture, and not a fat binary. I'd assume arm64 would be way to go.
How to get an arm64 binary that is not encrypted?
Run Product -> Archive in Xcode, then export the app Ad Hoc, and for the device to thin for, select a device with arm64 (an iPhone 5s or above)
Unzip the .ipa file that was exported, and Payload/<app name>.app/<app name> should be the executable that you want
# @gf3’s Sexy Bash Prompt, inspired by “Extravagant Zsh Prompt”
# Shamelessly copied from https://github.com/gf3/dotfiles
default_username='michaeleisel'
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then
export TERM=gnome-256color
elif infocmp xterm-256color >/dev/null 2>&1; then
export TERM=xterm-256color
fi