Skip to content

Instantly share code, notes, and snippets.

@choefele
choefele / Xcode crash
Last active August 29, 2015 14:00
Xcode crash when opening help
Process: Xcode [1860]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 5.1.1 (5085)
Build Info: IDEFrameworks-5085000000000000~10
App Item ID: 497799835
App External ID: 520942841
Code Type: X86-64 (Native)
Parent Process: launchd [251]
Responsible: Xcode [1860]
@choefele
choefele / extension
Last active August 29, 2015 14:15
How to know at run-time whether your code runs inside an iOS extension
NSDictionary *extensionInfo = [NSBundle.mainBundle objectForInfoDictionaryKey:@"NSExtension"];
NSString *extensionPointIdentifier = extensionInfo[@"NSExtensionPointIdentifier"];
if ([extensionPointIdentifier isEqualToString:@"com.apple.watchkit"]) {
NSLog(@"WatchKit extension");
} else if ([extensionPointIdentifier isEqualToString:@"com.apple.widget-extension"]) {
NSLog(@"Widget extension");
} else if (extensionPointIdentifier == nil) {
NSLog(@"iOS app");
} else {
NSLog(@"Unknown extension type");
@choefele
choefele / gist:aaf0edfcd2656901c08e
Created April 28, 2015 10:59
CocoaPods Podfile use_frameworks
platform :ios, '8.0'
use_frameworks!
source 'https://github.com/CocoaPods/Specs'
source 'git@github.com:optionu/Specs.git'
link_with 'HereToThere Widget', 'HereToThere WatchKit Extension'
pod 'FontAwesomeKit/FontAwesome'
pod 'FontAwesomeKit/FoundationIcons'
Build target Pods-CCHBinaryData
Write auxiliary files
/bin/mkdir -p /Users/choefele/Library/Developer/Xcode/DerivedData/Test-aprwsydqlazvlbacurkmubqnhure/Build/Intermediates/ArchiveIntermediates/Test/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/Pods-CCHBinaryData.build
write-file /Users/choefele/Library/Developer/Xcode/DerivedData/Test-aprwsydqlazvlbacurkmubqnhure/Build/Intermediates/ArchiveIntermediates/Test/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/Pods-CCHBinaryData.build/module.modulemap
/bin/mkdir -p /Users/choefele/Library/Developer/Xcode/DerivedData/Test-aprwsydqlazvlbacurkmubqnhure/Build/Intermediates/ArchiveIntermediates/Test/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/Pods-CCHBinaryData.build/Objects-normal/arm64
write-file /Users/choefele/Library/Developer/Xcode/DerivedData/Test-aprwsydqlazvlbacurkmubqnhure/Build/Intermediates/ArchiveIntermediates/Test/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/Pods-CCHBinaryData.build/Objects-normal/arm64/CCHBinaryD
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@choefele
choefele / gist:99654168c75d9bd81d9d
Created May 16, 2015 21:03
handleWatchKitExtensionRequest background task
func application(application: UIApplication, handleWatchKitExtensionRequest userInfo: [NSObject : AnyObject]?, reply: (([NSObject : AnyObject]!) -> Void)!) {
let completionBlock: () -> Void = {
reply(nil)
UIApplication.sharedApplication().endBackgroundTask(self.updateCacheTask)
}
updateCacheTask = application.beginBackgroundTaskWithExpirationHandler(completionBlock)
if let userLocation = DataProviderUtils.userLocationForUserInfo(userInfo) {
DataProviderService.retrieveTripsForUserLocation(userLocation, completionBlock: completionBlock)
} else {
@choefele
choefele / Podfile
Created May 26, 2015 09:53
NSLogger – Podfile
platform :ios, '8.0'
source 'https://github.com/CocoaPods/Specs'
pod 'NSLogger'
@choefele
choefele / gist:3bbdc9b7146f69b0cb70
Last active August 29, 2015 14:21
NSLogger – startNSLogger()
private class func startNSLogger() {
let paths = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true);
let file = "\(paths.first!)/loggerdata"
let bundleName = NSBundle.mainBundle().objectForInfoDictionaryKey(kCFBundleNameKey as String) as! String
let logger = LoggerInit()
LoggerSetBufferFile(logger, file)
LoggerSetOptions(logger, UInt32(kLoggerOption_BufferLogsUntilConnection | kLoggerOption_BrowseBonjour | kLoggerOption_BrowseOnlyLocalDomain))
LoggerSetupBonjour(logger, nil, bundleName)
LoggerStart(nil)
@choefele
choefele / gist:c4a31862d91cba9ac364
Created May 26, 2015 09:56
NSLogger – logMessage()
private class func logMessage(message: String) {
let appID = NSBundle.mainBundle().bundleIdentifier
LogMessage_va(appID, 0, message, getVaList([]))
}
//
// CCHLinkLabel.h
// Stolpersteine
//
// Created by Hoefele, Claus(choefele) on 21.01.14.
// Copyright (c) 2014 Option-U Software. All rights reserved.
//
#import <UIKit/UIKit.h>