title: Why error "cannot init a class object" occur when I execute my objective-C program?
body: <p>I just begin to learn objective-C. My first problem is I can't run the below source code.</p>
  
  <p>Here is my source code:</p>
  
  <pre><code>#import &lt;Foundation/NSObject.h&gt;
  #import &lt;stdio.h&gt;
  
  @interface Volume : NSObject
  -(id)init;
  @end
  
  @implementation Volume
  -(id)init 
  {
    self = [super init];
    return self;
  }
  @end
  
  int main(void){
    id o;
    o = [Volume init];
  }
  </code></pre>
  
  <p>Here is my error output:</p>
  
  <pre><code>$cc 96.m -framework Foundation
  $./a.out
  2014-09-18 10:10:40.116 a.out[759:507] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[Volume&lt;0x1069ca0f8&gt; init]: cannot init a class object.'
  *** First throw call stack:
  (
      0   CoreFoundation                      0x00007fff9019525c __exceptionPreprocess + 172
      1   libobjc.A.dylib                     0x00007fff951f4e75 objc_exception_throw + 43
      2   CoreFoundation                      0x00007fff90198490 +[NSObject(NSObject) dealloc] + 0
      3   a.out                               0x00000001069c9f46 main + 38
      4   libdyld.dylib                       0x00007fff93bab5fd start + 1
  )
  libc++abi.dylib: terminating with uncaught exception of type NSException
  Abort trap: 6
  </code></pre>
  
  <p>Here is my Environment:</p>
  
  <pre><code>$cc --version
  Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
  Target: x86_64-apple-darwin13.3.0
  Thread model: posix
  </code></pre>
  
  <p>Thanks.</p>