View gist:6d8f1b49da73e6fab743
# http://stackoverflow.com/a/23119866/1379492
- (void)prepareForReuse
{
[super prepareForReuse];
self.textView.editable = YES;
self.textView.editable = NO;
self.textView.text = nil;
}
View gist:6ecead686af9291da542
Set a watchpoint on a variable when it is written to.
(lldb) watchpoint set variable -w write global_var
(lldb) watch set var -w write global_var
(gdb) watch global_var
Set a watchpoint on a memory location when it is written into. The size of the region to watch for defaults to the pointer size if no '-x byte_size' is specified. This command takes raw input, evaluated as an expression returning an unsigned integer pointing to the start of the region, after the '--' option terminator.
(lldb) watchpoint set expression -w write -- my_ptr
(lldb) watch set exp -w write -- my_ptr
(gdb) watch -location g_char_ptr
Set a condition on a watchpoint.
(lldb) watch set var -w write global
View gist:11272383
- (NSString *)projectDirectoryPath
{
NSWindowController *currentWindowController = [[NSApp mainWindow] windowController];
id document = [currentWindowController document];
if (currentWindowController && [document isKindOfClass:NSClassFromString(@"IDEWorkspaceDocument")]) {
NSURL *workspaceDirectoryURL = [[[document valueForKeyPath:@"_workspace.representingFilePath.fileURL"] URLByDeletingLastPathComponent] filePathURL];
if(workspaceDirectoryURL) {
return [workspaceDirectoryURL path];
}
}
View gist:9957819
$ /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/\LaunchServices.framework/Versions/A/Support/\
lsregister -kill -r -domain local -domain user
$ killall Finder
View BETTestSemaphor.h
//
// BETTestSemaphor.h
// TwitterClient
//
// Created by Rafael Aguilar Martín on 11/11/12.
// Copyright (c) 2012 Rafael Aguilar Martín. All rights reserved.
//
#import <Foundation/Foundation.h>
View gist:8664759
p [(CALayer *)[[[[UIApplication sharedApplication] windows] objectAtIndex:0] layer] setSpeed:.1f]
View Appirater.md

Appirater

Appirater creo que es la librería open source más utilizada en Objective-C para recordar al usuario que si le gusta nuestra app que la vote.

Configuración

daysUntilPrompt

Los usuarios tendrán que tener la misma versión para que surta efecto. Se puede configurar el número de días que han pasado de la última vez que se mostró el aviso.

usesUntilPrompt

View gist:7589410

@see http://lifehacker.com/how-to-create-an-os-x-mavericks-usb-installation-drive-1450280026

  • Download OS X Mavericks from the Mac App Store, if you haven't already. If it tries to start the installation, just close it.
  • Insert your USB drive (you'll need one that's 8GB or larger) and open Disk Utility.
  • Select your drive in the sidebar and go to the Erase tab. Format the drive as "Mac OS Extended (Journaled)" and name the drive "Untitled." (Note: if you already have a drive or partition named "Untitled" connected to your computer, name it something else and change the corresponding variable in step 5's terminal command, or you might experience data loss!).
  • Click the Erase button and wait for Disk Utility to finish.
  • Close Disk Utility and open up a Terminal window. Copy and paste the command into the Terminal. sudo /Applications/Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ Mavericks.app --nointe
View gist:7352813
$ defaults write com.apple.finder AppleShowAllFiles -boolean true;
$ killall Finder