9 followers 0 articles/week
Printing Objective-C Invocations in LLDB

INTRODUCTIONA while ago Facebook open-sourced Chisel, a collection of commands and functions to assist in debugging iOS apps in LLDB. For a collection of tips and tricks on using LLDB in general (including Chisel tips), read my objc.io article on debugging: "Dancing in the Debugger - A Waltz with LLDB" and if you have some time you should read the entire objc.io edition...

Tue Mar 24, 2015 22:18
Git Rebase: Stepping Forward and Backward

Stepping ForwardYou are in the middle of an interactive rebase in git and you want to go forward *one* commit:  git rebase --edit-todoThen change the first line of the file to edit instead of pick then save and close the rebase-todo file. Finally run:  git rebase --continueStepping BackwardNow imagine that you want to go back one commit, while...

Sat Aug 9, 2014 07:42
Don't Retain That Class!

Let's take a look at a rather unsuspecting method. - (void)setClass:(Class):class forKey:(NSString *)key;There isn't much special about it. Most likely it belongs to some object that plays some dictionary-like role, but that doesn't really matter. What does is that I would have a hard time sleeping at night if I wrote that.I'm a pedant....

Sat Aug 9, 2014 07:42
Hmmm, What's that Selector?

The journey of a selector that is unrecognized.IntroductionThe atomic unit in Objective-C is an invocation, sending a selector to an object with some arguments. To invoke the selector doThings: on anObject we write the familiar line. [anObject doThings:things];Usually this calls into the method and all is well. But what happens when anObject doesn't...

Sat Aug 9, 2014 07:42
Why objc_msgSend Must be Written in Assembly

Every message send in Objective-C is compiled into a call to objc_msgSend, a function that is called with the arguments as the message sense but with the receiver and the selector as the first two. So the line [receiver message:foo beforeDate:bar];will be compiled into to just call a C function: objc_msgSend(receiver, @selector(message:beforeDate:),...

Sat Aug 9, 2014 07:42
A Tiny Bit on Objective-C BOOLs

Note: This entire discussion applies only to the 32-bit run-time. In the 64-bit run-time BOOL is actually _Bool and is a real type. :D It doesn't take very long with Objective-C to start using BOOLs. There are already many awesome discussions out there on their subtle, obnoxious behavior, with the following being two of the best:https://www.mikeash.com/pyblog/friday-qa-2012-12-14-objective-c-pitfalls.htmlhttp://blog.bignerdranch.com/564-bools-sharp-cornersThere...

Sat Aug 9, 2014 07:42

Build your own newsfeed

Ready to give it a go?
Start a 14-day trial, no credit card required.

Create account