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 923825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:15:10+00:00 2026-05-15T19:15:10+00:00

I have an ObjC object defined as follows @interface Fruit : NSObject { int

  • 0

I have an ObjC object defined as follows

@interface Fruit : NSObject
{
    int fruitsinbranch[4];
}
@property (readonly) int fruitsinbranch[4];
@end

And then in the implementations I have the usual

@synthesize fruitsinbranch[4];

It does not work. What’s the right way of doing it?

(And no, I am not asking for other ways to do stuff, like NSArray etc… I want an answer to the question I posed).

UPDATE: my solution is lame but it works. I created the method

-(int) fruitsinbranch:(int) i

That gave a solution close enough to what I wanted.

  • 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-05-15T19:15:11+00:00Added an answer on May 15, 2026 at 7:15 pm

    The closest thing you can get is to use an int* property and not synthesize the getter:

     @interface Fruit : NSObject {
         int fruitsinbranch[4];
     }
     @property (readonly) int* fruitsinbranch;
     - (int *)fruitsinbranch { return fruitsinbranch; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Under ARC , I have an object, Child that has a weak property, parent
I have an ObjC controller object. After alloc/init of the object, I get it
I have an Obj-C 2.0 class that has an NSMutableArray property. If I use
I have been given an error on the Mac: objc[30344]: FREED(id): message release sent
I have an app that uploads to Google Spreadsheets via the GData ObjC client
The setting is the following: I have a cocoa object in a nib file
Lets say I have this enum defined (from Apple's UIKit framework): typedef enum {
I have a core-data object entity with 2 fields - name (a NSString *)
I have a Managed Object Context to which I add two different SQLite stores.
I have a property that looks like this: @property (weak, nonatomic) id<NavigationControllerDelegate> delegate; But

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.