O'Reilly logo

Objective-C Programming: The Big Nerd Ranch Guide by Mikey Ward, Aaron Hillegass

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Management of classes and inheritance hierarchies

The Runtime is responsible for keeping track of which classes you’re using, as well as those being used by the libraries and frameworks included in your application. There are a number of functions that exist in order to manipulate the classes loaded by the Runtime.

Create a new Foundation Command Line Tool named ClassAct.

In main.m, update the main function with the following code. Make sure you import objc/runtime.h at the top.

#​i​m​p​o​r​t​ ​<​F​o​u​n​d​a​t​i​o​n​/​F​o​u​n​d​a​t​i​o​n​.​h​>​
#​i​m​p​o​r​t​ ​<​o​b​j​c​/​r​u​n​t​i​m​e​.​h​>​ i​n​t​ ​m​a​i​n​(​i​n​t​ ​a​r​g​c​,​ ​c​o​n​s​t​ ​c​h​a​r​ ​*​ ​a​r​g​v​[​]​)​ {​ ​ ​ ​ ​@​a​u​t​o​r​e​l​e​a​s​e​p​o​o​l​ ​{​ ​ ​ ​ ​ ​ ​ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required