title: Calling a method on an uninitialized object (null pointer)
body: <ol>
  <li>What is the normal behavior in Objective-C if you call a method on an object (pointer) that is nil (maybe because someone forgot to initialize it)? Shouldn't it generate some kind of an error (segmentation fault, null pointer exception...)?</li>
  <li>If this is normal behavior, is there a way of changing this behavior (by configuring the compiler) so that the program raises some kind of error / exception at runtime?  </li>
  </ol>
  
  <p>To make it more clear what I am talking about, here's an example.  </p>
  
  <p>Having this class:</p>
  
  <pre><code>@interface Person : NSObject {
  
      NSString *name;
  
  }
  
  @property (nonatomic, retain) NSString *name;
  
  - (void)sayHi;
  
  @end
  </code></pre>
  
  <p>with this implementation:</p>
  
  <pre><code>@implementation Person
  
  @synthesize name;
  
  - (void)dealloc {
      [name release];
      [super dealloc];
  }
  
  - (void)sayHi {
      NSLog(@"Hello");
      NSLog(@"My name is %@.", name);
  }
  
  @end
  </code></pre>
  
  <p>Somewhere in the program I do this:  </p>
  
  <pre><code>Person *person = nil;
  //person = [[Person alloc] init]; // let's say I comment this line
  person.name = @"Mike";            // shouldn't I get an error here?
  [person sayHi];                   // and here
  [person release];                 // and here
  </code></pre>