title: CGFloats, floats getting set to zero
body: <p>I have a custom class Custom.mm in which I am trying to set a float value using a setter in my controller class MainController. The Custom instance is typed as an id because it is an Obj-C++ file and pointing to a proper class at compile time has worked well for me. Everything works fine, the instance is verified. If I set up the amount variable as type int and pass ints it works fine. Same with any other value or object--except floats. For some reason floats (float, CGFloat and the like) are set to 0 in the Custom.mm class. This is not an issue with NSLog or anything--I've checked the amount variable with a breakpoint and everything works but floats.</p>
  
  <pre><code>    //Custom.h
   @interface Custom : UIView  
  {
  
        CGFloat amount;
  
  }
  
   @property CGFloat amount;
  
   @end
  </code></pre>
  
  <hr>
  
  <pre><code>    //Custom.mm
  @implementation Custom
  @synthesize  amount;
  
  - (id) initWithCoder:(NSCoder*)coder
  {
      if ((self = [super initWithCoder:coder])) 
      {
          //set initial value to 1
          self.amount = 1.0;  //verified as 1.0
      }
      return self;
  }
  </code></pre>
  
  <hr>
  
  <pre><code>    //MainController.h
  @interface MainController : UIViewController 
  {
      IBOutlet id customInstance; //IB points to the CustomView class
  }
  </code></pre>
  
  <hr>
  
  <pre><code>    //MainController.m
  @implementation MainController
  
  -(void)viewDidLoad
   {
          [super viewDidLoad];
  
          //Checking this value in Custom.mm via the debugger shows it as being 0, 
          //when before it was 1.0. 
          [customInstance setAmount:2.0]; 
    }
  
   @end
  </code></pre>