title: cannot init a class object-Objective C
body: <p>I need to call a method that has been defined in the same class.I am calling the method initiateSession from the function A.</p>
  
  <pre><code>-(BOOL)intitiateSession
  {
   //stmts
   return YES;
  }
  -(BOOL)A
  {
   if([self initiateSession])
   {
    //stmts
   }
   return YES;
  }
  </code></pre>
  
  <p>getting a runtime error as,</p>
  
  <p>Terminating app due to uncaught exception</p>
  
  <blockquote>
    <p>cannot init a class object</p>
  </blockquote>
  
  <h2>EDITED:</h2>
  
  <pre><code>@implementation Data
  -(BOOL)initiateSession
  {
  NSLog(@"I am into the initiateSession!!");
  return YES;
  }
  -(BOOL)getNHPData{
          NSLog(@"In getNHPData!!");
          if([self initiateSession])
                     {
                         NSLog(@"I am into the session");
                     }
       return YES;
  }
  @end
  </code></pre>
  
  <p>Here in the if loop i will call the function.Execute the function and if the function </p>
  
  <p>executes to true i'm getting inside the scope.I could not able to call one function from </p>
  
  <p>other function.</p>