title: Making pointer from integer in Objective C
body: <p>After programming with C# and Java for many years I finally decided to learn Objective-C in order to start programming iOS Devices as well as Mac OS X, and I have to admit it is very different then most modern c-based programming languages. I am getting the following warning in my code:</p>
  
  <blockquote>
    <p>warning: passing argument 1 of 'SetAge' makes pointer from integer without a cast</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <p>Dog.h</p>
  
  <pre><code>#import &lt;Cocoa/Cocoa.h&gt;
  
  
  @interface Dog : NSObject {
      int ciAge;
      NSString * csName;
  }
  
  - (void) Bark;
  - (void) SetAge: (int *) liAge;
  - (void) SetName: (NSString *) lsName;
  
  @end
  </code></pre>
  
  <p>Dog.m</p>
  
  <pre><code>#import "Dog.h"
  
  @implementation Dog
  
  - (void) Bark
  {
      NSLog(@"The dog %@ barks with age %d", csName, ciAge);  
  }
  
  - (void) SetAge: (int *) liAge {
      ciAge = (int)liAge;
  }
  
  - (void) SetName: (NSString *) lsName {
      csName = lsName;
  }
  @end
  </code></pre>
  
  <p>HelloWorld.m</p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  #import "Dog.h"
  
  
  int main (int argc, const char * argv[]) {
      NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
  
      int liTemp = 75;
      NSString * lsCity = @"Chicago";
      NSDate * loDate = [NSDate date];
  
      // insert code here...
      NSLog(@"The temperature is %d currently in %@, on %@", liTemp, lsCity, loDate);
  
      int liAge = 10;
  
      // Call Dog class
      Dog * Dog1 = [Dog new];
      [Dog1 SetAge:(int)liAge]; // The Warning happens here
      [Dog1 SetName:@"Fido"];
  
      [Dog1 Bark];
  
  
      [pool drain];
      return 0;
  }
  </code></pre>
  
  <p>My Questions Are:</p>
  
  <ol>
  <li>How do I get rid of the warning above?</li>
  <li>Instead of creating methods in the Dog Class for setting Age and Name, how could I have make Age and Name public class level variables that I could directly assign to?</li>
  </ol>
  
  <p>Any help would be much appreciated!</p>
  
  <p>Thanks,
  Pete</p>