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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:57:04+00:00 2026-06-02T07:57:04+00:00

While creating a custom iOS table view cell, I created a new .xib file,

  • 0

While creating a custom iOS table view cell, I created a new .xib file, dragged/dropped some UI elements in interface builder and my .h file looked like this…

#import <UIKit/UIKit.h>

@interface MasterTableViewCell : UITableViewCell
{
    IBOutlet UILabel *cellLabel;
    IBOutlet UIImage *cellImage;
}

@property (nonatomic, retain) IBOutlet UILabel *cellLabel;
@property (nonatomic, retain) IBOutlet UIImage *cellImage;

@end

On some blogs I saw that the instance variables were missing. When do I need to declare instance variables? Are both instance variables and @property declarations not needed for a particular UI object.
Also I am creating the app using automatic reference counting, so garbage collection needs aren’t there as well. What difference does that make in usage of instance variables & properties?

  • 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-02T07:57:05+00:00Added an answer on June 2, 2026 at 7:57 am

    There is no garbage collection in iOS. iOS uses reference counting to track ownership of objects. Using ARC does not do away with reference counting, but the compiler takes care of releasing and retaining objects. When using ARC you are not allowed to send a retain, release, or autorelease message to an object, nor are you allowed to call [super dealloc] in a dealloc method. In your code above, since you are using ARC, the ‘retain’ attributes should be replaced by the ‘strong’ attribute.

    When you use @property, and the corresponding @synthesize in your implementation, you do not need to create a backing instance variable – the compiler does that for you. @property along with @synthesize create your accessor methods (your getters and setters), and also enable you to use dot notation to refer to your objects’ properties. You may still write your own accessor methods if you choose.

    The above code could be replaced by the following:

    #import <UIKit/UIKit.h>
    
    @interface MasterTableViewCell : UITableViewCell
    
    @property (nonatomic, strong) IBOutlet UILabel *cellLabel;
    @property (nonatomic, strong) IBOutlet UIImage *cellImage;
    
    @end
    

    In your implementation file you would have:

    #import "MasterTableViewCell.h"
    
    @implementation MasterTableViewCell
    
    @synthesize cellLabel;
    @synthesize cellImage;
    

    or

    @synthesize cellLabel, cellImage;
    
    ... remainder of your code
    

    In your code, to ensure that you are using your accessor methods, use ‘self’ to refer to your properties:

    self.cellLabel.text = @"some text";
    

    or

    [[self cellLabel] setText:@"some text"];
    

    I hope this helps clarify things a little.

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

Sidebar

Related Questions

While creating a file synchronization program in C# I tried to make a method
While creating an online shop application using play-1.2.4 ,I ran into some problems with
While creating a (custom) content in Drupal, I have three vocabularies. But these make
While developing widgets (objects, which - rendered - use some custom javascript files), I
I am creating a Custom Grid kind of View for my App. I am
while creating custom item renderers which interfaces we need to implement? Thank in advance.
I am creating a custom UITableViewCell to include an UIImageView and some related text.
While I was creating my custom template for node, I found out that Drupal
I can not set the custom cells accessory view while the page loads for
I'm looking for tutorials on creating custom view transitions. In particular, transitions that involve

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.