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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:14:11+00:00 2026-05-20T14:14:11+00:00

I have been playing a bit with the memory in order to be a

  • 0

I have been playing a bit with the memory in order to be a good memory citizen on the iPhone SDK.

However I still struggle to understand the difference between “self.something” and just “something”.

As far as I understood, “self.something” means ask to the class for “something”, but there is something wrong on my thought. Let’s see the example:

I have worked with the memory releasing:

  1. [self.labelIBOUtlet release] -> It crash
  2. [labelIBOUtlet release] -> It doesn’t.

Can anyone please explain me what is the reason?

Thank you!

EDIT:

This is the information I have set on the header file:

@interface viewController : UIViewController {
    UILabel * labelIBOutlet ;
}

@property (nonatomic,retain) IBOutlet UILabel * labelIBOutlet ;
  • 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-20T14:14:11+00:00Added an answer on May 20, 2026 at 2:14 pm

    You have to understand the meaning of “property”
    the use of “dot” is just a faster way to call “special methods” created just to “set” and “get” variable-property.

    as example, you could have your own class/UIView which uses a subView:

    in myView.h

    @interface myView : UIView  {
        UIWebView *webView;
    }
    

    if you do just this you have not a “property”, but just an ojbect…
    so in your myView.m you try to use the “dot” like this:

    NSLog(@"%i", self.webView.frame.size.width);
    

    then you get an error, you cannot do that, xCode says:
    error: accessing unknown ‘webView’ getter method

    that just means that a the method “webView” doesn’t exist…
    ‘couse when you call “self.webView” you just call a method called “webView”…
    this method just return the pointer to your value.
    and when you call:

    self.webView=someValue;
    

    you are just calling the method “setWebView”, a method that just set your object with someValue…

    but so… where do those 2 invisible methods come from?

    they are created by xCode itself if you tell it to use webView as a property…
    in our example, add some lines:

    in myView.h

        @interface myView : UIView  {
            UIWebView *webView;
        }
    
    @property (nonatomic, retain)  UIWebView *webView;
    

    in myView.m

    @implementation myView
    
    @synthesize webView;
    
    // ...
    

    doing this xCode will add the 2 methods “webView” and “setWebView” for you,
    and now you can call:

    NSLog(@"%i", self.webView.frame.size.width);
    

    with no error…

    and you can put value (of the right format, in this case a pointer to an existing UIWebView)
    just calling:

    self.webView = aUIWebView;
    

    and remember to release it, ‘couse you used “retain” in :

    @property (nonatomic, retain)  UIWebView *webView;
    

    release it with:

    [webView release];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been playing around with GIT on my local computer. As I have
I have been trying this for so long, but was not able to implement
I've been playing with Entity Framework 4, using the model driven approach to generate
I've been playing around with adding hidden iframe elements to a page, and I
I've been playing with an app and I wanted to add the ability to
I have a website which I have been working on creating very rapidly, and
I have been using a custom type for Money with my POCOs and tries
I have been trying to store image form android sdcard to the sqlite database.
How can I stop one SWF file playing when playing another in a HTML
I've got a MySQL table with, among other things, two fields: a (int) and

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.