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

  • Home
  • SEARCH
  • 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 7788221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:55:40+00:00 2026-06-01T20:55:40+00:00

I have spent a few days learning Objective-C and have a few questions about

  • 0

I have spent a few days learning Objective-C and have a few questions about @property. I have experience with C# so understand the need for pointers, initialization etc.

So as an example:

 @interface MyClass : NSObject
 {
      IBOutlet UIImageView *image;
 }

 @property (retain, nonatomic) UIImageView *image

 @end

 @implementation MyClass
      @synthesise image
 @end

I understand that @synthesise is used to create the @property. But I have a few questions just to help me clear things up:

  1. Does the @property duplicate or replace my original definition, or does it merely set up the mutibility and atomicity of the original?
  2. Does @synthesise remove my need to use image = [[UIImageView alloc] init]?
  3. If I do not provide a @property and still go ahead creating and destroying my variable manually, does that make any difference?

Ultimately, is the difference between the 2, @property gives you more flexibility with regards to memory management and multi-threading and the normal one gives you the defaults.

  • 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-01T20:55:42+00:00Added an answer on June 1, 2026 at 8:55 pm

    Does the @prototype duplicate or replace my original definition, or does it merely set up the mutibility and atomicity of the original?

    The ivar declaration of image is redundant when using the most recent compiler releases.

    The former declares an ivar (type + name + instance storage).

    The property declaration specifies the type, name, storage (in more recent compiler releases), declares the accessor methods (e.g. - (UIImageView *)image; and - (void)setImage:(UIImageView *)pImage;), and other property specifiers (which are used when the accessors are generated by the compiler).

    Does @synthesise remove my need to use image = [UIImageView alloc]?

    No. You still need to implement your initializer and dealloc (in MRC) appropriately.

    If I do not provide an @property and still go ahead creating and destroying my variable manually, does that make any difference?

    That would be fine, when you do not want/need boilerplate accessor methods generated for you. It’s a design choice. Not every ivar needs accessor methods.

    Ultimately, is the difference between the 2, @property gives you more flexibility with regards to memory management and multi-threading and the normal one gives you the defaults.

    The biggest reason they exist is convenience. Properties save a lot of boilerplate code.

    There is no more flexibility with properties — properties implement the most practical uses.

    It’s infrequent that atomicity (in this context) is equivalent to proper thread safety and correct concurrent execution.

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

Sidebar

Related Questions

I have spent a few days learning and writing NSCoding and finally got it
I have spent the last few days attempting to integrate a Grails (version 1.3.2)
I have spent a few days on a personal productivity tool and am currently
I have spent the last few days playing around with Drupal for the first
I have spent few days to work on Service + BroadcastReceiver, but still cannot
I have spent the last few days trying to parse a SOAP response but
A colleague and I have spent a few years developing a really cool Matlab
I have spent about half a day searching for an answer to this question
I have been struggling with this problem for a few days now and I
I've spent so much time the last few days trying to work out some

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.