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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:53:31+00:00 2026-06-05T13:53:31+00:00

Sorry for the simple question. When I see a definition of a property inside

  • 0

Sorry for the simple question.
When I see a definition of a property inside the h file, but outside of the class @interface scope, what does it mean ?

@property (nonatomic, readonly) RMMapContents *mapContents;

Here is the code:

@class RootViewController;
@class RMMapContents;

@interface MapTestbedAppDelegate : NSObject <UIApplicationDelegate> {
    UIWindow *window;

    //MAIN VIEW
    //==============

    RootViewController *rootViewController;


    // NETWORK DATA
    // =============

    NSMutableArray  *photoTitles;         // Titles of images
    NSMutableArray  *photoSmallImageData; // Image data (thumbnail)
    NSMutableArray  *photoURLsLargeImage; // URL to larger image
    NSMutableData *receivedData;
    NSURLConnection *theConnection;
    NSURLRequest *request;
}

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet RootViewController *rootViewController;
@property (nonatomic, readonly) RMMapContents *mapContents;


@end

Inside a function I see this line:

- (void)foo:(xyz *)abc{
  ..
  RMMapContents *mapContents = [self mapContents];
  ..
}

So, taking it from C++, the mapContents seem like it is not a global scope var (after all, that’s why they call them properties, right?), but isn’t defining the same name again inside the function weird a bit?

I hope someone can clarify a little here.
Thanks!

  • 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-05T13:53:34+00:00Added an answer on June 5, 2026 at 1:53 pm

    The scope of the @interface block extends upto the @end keyword and is not restricted to the braces {}.

    So the @property declaration lies very much inside the scope of the @interface and like cli_hlt rightly answered, it acts like a substitute to setter and getter methods for the mapContents property.

    so a property named mapContents, would have setters and getters which look like this :

    - (void)setMapContents; //setter
    
    - (RMMapContents *)mapContents; //getter
    

    and would can be accessed from within the class using these methods:

    [self setMapContents:newContents];
    

    AND

    RMMapContents *contents = [self mapContents];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry for this simple question, but I can't solve it... There is an example:
sorry this is such a simple question but I can't figure it out. How
Sorry if this is a dead simple question but I'm confused from the documentation
sorry for the dummy question but I cannot find a simple and clean way
Sorry to bother you with such a simple question, but I'm stuck here since
OK, sorry for the overly broad question, but let's see what you guys suggest....
I'm sorry, I know this is a very simple question but I've search here
Sorry if this is a dense question, but I'm looking to see if there
sorry if this is a simple question but I'm having trouble exporting my java
Sorry to bother you folks. But i have a simple question. Ho can I

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.