In this chapter, you will learn about the life of objects on the heap and how heap memory is managed.
Objects can only be accessed via a pointer, and it is practical, if inaccurate, to refer to an object by its pointer, as in “now is an NSDate.” However, is important to remember that the pointer and the object that it points at are not the same thing. Here is a more accurate statement: “now is a pointer that can hold an address of a location in memory where an instance of NSDate lives.”
Create a new Command-line Tool named TimesTwo. Make its type Foundation. In main.m, declare a variable that points to an instance of NSDate.
#import <Foundation/Foundation.h> ...