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)removeDataStoreAtURL:(NSURL*)url | |
{ | |
// Need to remove anything matching the first part - there are also logging files alongside the SQLite file itself. | |
// Typical directory contents are: | |
// Name.sqlite, Name.sqlite-shm, Name.sqlite-wal | |
NSURL *folderURL = [url URLByDeletingLastPathComponent]; | |
NSArray *contents = [[NSFileManager defaultManager] contentsOfDirectoryAtURL:folderURL includingPropertiesForKeys:nil options:0 error:nil]; |
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 Foundation | |
import Cocoa | |
for arg in Process.arguments[1...Process.arguments.count - 1] { | |
let cgDataRef = CGImageSourceCreateWithURL(NSURL.URLWithString("file://\(arg)"), nil).takeUnretainedValue() | |
let imageDict:CFDictionaryRef = CGImageSourceCopyPropertiesAtIndex(cgDataRef, 0, nil).takeUnretainedValue() | |
println(imageDict) | |
} |
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
CGRect keyboardFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue]; | |
keyboardFrame = [self.view.window convertRect:keyboardFrame fromWindow:nil]; | |
keyboardFrame = [self.view convertRect:keyboardFrame fromView:nil]; |