Does Objective-C Perform Autoboxing on Primitives?

by Marcus Zarra

This article is inaccurate.

The writer was smoking crack or something when he wrote it and has not been able to duplicate his tests since. This article is left here for historical reasons.

One of the things about Objective-C that I find extremely useful is the ability to resolve a method call at runtime. In addition this same functionality allows us to do some fairly creative things with callbacks, passing messages between threads, etc.

However there is a bit of a trick when it comes to passing primitives though some of these methods. For example, one method that I use quite frequently is performSelectorOnMainThread:withObject:waitUntilDone:. How exactly does one pass a BOOL or an int to this method?