Multiple files

Notice that your project now has executable code in two files: main.m and BNRPerson.m. (BNRPerson.h is a declaration of a class and has no executable code in it.) When you build the project, these files are compiled separately and then linked together. It is not uncommon that a real-world project will consist of hundreds of files of C and Objective-C code.

When Xcode builds your project, it compiles each of the .m and .c files into machine code. Then, it links those files together with any libraries into the executable file. What libraries? In this section of the book, all of your executables have been link to the Foundation framework.

There are many libraries of reusable code downloadable from the internet. A ...

Get Objective-C Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.