title: create a storage class in objective-c
body: <p>Hi I am trying to build a storage class for my iphone app. The storage class is for storing a list of food orders and each order has a food name and price. In the app, I want to store it in order into an array named orders when i press a button at my food menu.I am new to Objective-c,
  and I am a Java user. What I want to build is a storage class which is similiar to java's ArrayList class, and  the myStorage class holds the food name and price.</p>
  
  <p>I have build some codes already, but compiled with error "Local delcaration of 'order' hides instance variable' on my Storages.h at @property (nonatomic) NSMutableArray *orders;</p>
  
  <p>Storage.h</p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  
  @interface Storage : NSObject{
      NSString *name;
      NSInteger *price;
  }
  @property (nonatomic)NSString *name;
  @property (nonatomic)NSInteger *price;
  -(void) setName: (NSString *) n;
  -(void) setPrice: (NSInteger *) p;
  -(NSString *)getName;
  -(NSInteger *)getPrice;
  
  @end
  </code></pre>
  
  <p>Storage.m</p>
  
  <pre><code> #import "Storage.h"
  
   @implementation Storage
  
  
   @synthesize name;
   @synthesize price;
  
  
   - (void)setName:(NSString *)n {
       name = n;
  }
   - (void)setPrice:(NSInteger *)n {
      price = n;
  }
  - (NSString *)getName{
  return name;
  }
  - (NSInteger *)getPrice{
      return price;
  }
  
  
  @end
  </code></pre>
  
  <p>Storages.h</p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  #import "Storage.h"
  @interface Storages : NSObject{
      Storage *order;
      NSMutableArray *orders;
  
  @property (nonatomic) NSMutableArray *orders; // error "Type of property 'orders' does not match type of accessor 'setOrder'"
  
  -(void) setOrders:(Storage *)order;
  -(NSMutableArray *) orders;
  @end
  </code></pre>
  
  <p>Storages.m</p>
  
  <pre><code>#import "Storages.h"
  
  @implementation Storages
  @synthesize orders;
  
  -(void) setOrders:(Storage *)oneOrder{  
  
      [orders addObject: oneOrder];
  }
  -(NSMutableArray *) orders;{
      return orders;
  }
  @end
  </code></pre>