git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
Greetings, NSHipsters!
As we prepare to increment our NSDateComponents -year
by 1
, it's time once again for NSHipster end-of-the-year Reader Submissions! Last year, we got some mind-blowing tips and tricks. With the release of iOS 7 & Mavericks, and a year's worth of new developments in the Objective-C ecosystem, there should be a ton of new stuff to write up for this year.
Submit your favorite piece of Objective-C trivia, framework arcana, hidden Xcode feature, or anything else you think is cool, and you could have it featured in the year-end blowout article. Just comment on this gist below!
Here are a few examples of the kind of things I'd like to see:
NSStringFromSelector(@selector())
as a safer way to do KVC / KVO / NSCoding.- (void)openMenu:(CCMenuItem *)item; | |
{ | |
// UI KITTTTTTTTTT | |
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"DMMainMenu_iPhone" bundle:nil]; | |
UIViewController *menu = [storyboard instantiateViewControllerWithIdentifier:@"DMMainMenuNavigationController"]; | |
menu.modalPresentationStyle = UIModalPresentationFullScreen; | |
menu.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; | |
if (menu) { | |
[[CCDirector sharedDirector] presentViewController:menu animated:YES completion:^{ | |
[[CCDirector sharedDirector] pause]; |
##XXAppDelegate.m, XXSomeView.m, some other object, etc##
...
[[XXSomeSingletonController sharedInstance] doThatThing];
...
##XXSomeSingletonControllerObserver.h##
@protocol XXSomeSingletonControllerObserver
Unfortunately, xcode does not yet have support for importing OSX crash logs and symbolizing them. Therefore, you must use the command line and a little bit of manual work.
#!/bin/env ruby | |
deviceTypes = { | |
"iPhone 4s" => "com.apple.CoreSimulator.SimDeviceType.iPhone-4s", | |
"iPhone 5" => "com.apple.CoreSimulator.SimDeviceType.iPhone-5", | |
"iPhone 5s" => "com.apple.CoreSimulator.SimDeviceType.iPhone-5s", | |
"iPhone 6 Plus" => "com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus", | |
"iPhone 6" => "com.apple.CoreSimulator.SimDeviceType.iPhone-6", | |
"iPad 2" => "com.apple.CoreSimulator.SimDeviceType.iPad-2", | |
"iPad Retina" => "com.apple.CoreSimulator.SimDeviceType.iPad-Retina", |
<figure class="image"> | |
{% capture image_src %}{% if include.file %}/content/{{ page.path | remove_first:'_posts/' | split:'.' | first }}/{{ include.file }}{% else %}{{ include.url }}{% endif %}{% endcapture %} | |
<a href="{{ image_src }}"> | |
<img src="{{ image_src }}" alt="{{ include.description }}" /> | |
</a> | |
{% if include.description %} | |
<figcaption>{{ include.description }}</figcaption> | |
{% endif %} | |
</figure> |
diskutil list | |
diskutil unmount /dev/disk0s6 | |
sudo mount -w -t msdos /dev/disk0s6 /Volumes/data |