Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9231517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:05:22+00:00 2026-06-18T06:05:22+00:00

I am trying to build a storage class for my iPhone app. The storage

  • 0

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 2 dimension array named orders when I press a button at my food menu.I am a Java user, and new to Objective-C. What I want to build is a storage class which is similar to java’s ArrayList class, and the Storage.m class holds the food name and price.

I have some code already, but it keeps shows up with this error: “Type of property ‘orders’ does not match type of accessor ‘setOrder’ ” in my Storages.h class.

Storage.h

#import <Foundation/Foundation.h>

@interface Storage : NSObject{
    NSString *name;
    NSInteger *price;
}
@property (nonatomic)NSString *name;
@property (nonatomic)NSInteger *price;


@end

Storage.m

 #import "Storage.h"

 @implementation Storage


 @synthesize name;
 @synthesize price;


@end

Storages.h

#import <Foundation/Foundation.h>
#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

Storages.m

#import "Storages.h"

@implementation Storages
@synthesize orders;

-(void) setOrders:(Storage *)oneOrder{  

    [orders addObject: oneOrder];
}
-(NSMutableArray *) orders;{
    return orders;
}
@end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:05:23+00:00Added an answer on June 18, 2026 at 6:05 am

    Since you have a property called “orders”, the function “setOrders” is overriding the setter method of that property.So to make it work you’ll have to change the name of setOrders: function to something like addOrder:(Storage *)order.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying build an App Engine connected Android application and am having some problems
Background: I'm trying to build a web app (as a personal project using modern
I'm trying to build an app to move stocks around. I have products and
I'm trying to build a small app that takes a data file in external
I'm trying to build an mobile application using backbone.js that will: Load a list
I'm trying to build a history list of clicked clicked page elements and store
I'm trying to build an Android app which makes use of the NativeActivity facility
I am trying build a jQuery EasyUI datagrid or treegrid out of a large
I was trying Build For Archiving application (from Titanium Mobile) with xCode 4.4, but
I'm trying build a method which returns the shortest path from one node to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.