title: How to fix "bad receiver type" error
body: <p>I am making an app that allows you to set the name and number of sides of and then the app will automatically calculate the shapes name. I've been asked to change the number of sides from an <code>NSNumber</code> to an <code>int</code>. I have done this but now I get a error saying "bad receiver type". What can I do to correct this but keep the number of side property an <code>int</code>?</p>
  
  <p>This is my header file for the class</p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  
  @interface shape : NSObject
  
  @property int *numberOfSides;
  @property (nonatomic, strong) NSString *name;
  @property (nonatomic, strong) NSString *colour;
  
  @property (nonatomic, strong) NSString *calculatedName;
  
  void waitOnCR (void);
  - (NSString *)calculatedName;
  
  @end
  </code></pre>
  
  <p>This is the implementation file for the class</p>
  
  <pre><code>- (NSString *)calculatedName {
      if ([self.numberOfSides isEqual: @3]) {
          return self.name = @"Triangle";
      }
      else if([self.numberOfSides isEqual: @4]) {
          return self.name = @"Square";
      }
      else if([self.numberOfSides isEqual: @5]) {
          return self.name = @"Pentagon";
      }
      else if([self.numberOfSides isEqual: @6]) {
          return self.name = @"Hexagon";
      }
      else if([self.numberOfSides isEqual: @7]) {
          return self.name = @"Heptagon";
      }
      else if([self.numberOfSides isEqual: @8]) {
          return self.name = @"Octagon";
      }
  
      return [NSString stringWithFormat:@"%@", self.name ];
  }
  
  @end
  </code></pre>
  
  <p>This is the Main file</p>
  
  <pre><code>NSLog(@"Enter a number from between 3-8");
  
  int user;
  
  scanf("%d" , &amp;user);
  
  switch (user) {
      case 3:
      {
          shape *myShape = [[shape alloc]init];
          [myShape setNumberOfSides:3];
          [myShape setColour:@"Red"];
          id s2 = [myShape calculatedName];
  
  
          NSLog(@"The %@ shape has %i sides and is called a %@", [myShape colour], [myShape numberOfSides], s2);
          break;
      }
      case 4:
      {
          {
              shape *myShape = [[shape alloc]init];
              [myShape setNumberOfSides:@4];
              [myShape setColour:@"Blue"];
              id s2 = [myShape calculatedName];
  
              NSLog(@"The %@ shape has %@ sides and is called a %@", [myShape colour], [myShape numberOfSides], s2);
              break;
          }
      case 5:
          {
              shape *myShape = [[shape alloc]init];
              [myShape setNumberOfSides:@5];
              [myShape setColour:@"Orange"];
              id s2 = [myShape calculatedName];
  
              NSLog(@"The %@ shape has %@ sides and is called a %@", [myShape colour], [myShape numberOfSides], s2);
              break;
          }
      case 6:
          {
              shape *myShape = [[shape alloc]init];
              [myShape setNumberOfSides:@6];
              [myShape setColour:@"Purple"];
              id s2 = [myShape calculatedName];
  
              NSLog(@"The %@ shape has %@ sides and is called a %@", [myShape colour], [myShape numberOfSides], s2);
              break;
          }
      case 7:
          {
              shape *myShape = [[shape alloc]init];
              [myShape setNumberOfSides:@7];
              [myShape setColour:@"Green"];
              id s2 = [myShape calculatedName];
  
              NSLog(@"The %@ shape has %@ sides and is called a %@", [myShape colour], [myShape numberOfSides], s2);
              break;
          }
      case 8:
          {
              shape *myShape = [[shape alloc]init];
              [myShape setNumberOfSides:@8];
              [myShape setColour:@"Pink"];
              id s2 = [myShape calculatedName];
  
              NSLog(@"The %@ shape has %@ sides and is called a %@", [myShape colour], [myShape numberOfSides], s2);
              break;
          }
  
      }
      default:
          NSLog(@"Shape not found!");
          break;
  }
  </code></pre>