Starting with arithmetic expressions but I already read that last class.
Everything inherits from NSObject.
Define the implementation of the Person class.
Define the interface for Person.
strong vs weak references
Strong reference is like a dog on a leash. The dog wants to run a way. strong is like the leash. As long as the pointer is strong then the dog can’t run away. With a weak reference the dog can run away.
Instead of calling it invoking a method or calling a function it is described as “sending a message”.
To invoke a class method.
To invoke an instance method.
Documentation for NSObject#new
new Allocates a new instance of the receiving class, sends it an init message, and returns the initialized object.
- (id)new Return Value A new instance of the receiver.
Discussion This method is a combination of alloc and init. Like alloc, it initializes the isa instance variable of the new object so it points to the class data structure. It then invokes the init method to complete the initialization process.
You will never see people use “new”. Instead they use alloc and init.
To get and set you can send messages to the object. To set a property you need to prefix the message with “set”.