Self and super

Hi developers,
I would like to know if anyone knows of some good site(s) and/or book(s) that explain(s) the meaning of SELF and SUPER (with respect to Objective-C) as I myself am a newbie to the superset of the C language and find it confusing to understand what SELF and SUPER do.
Cheers
PS: I also posted the same message on the other forum (S/W Dev 101)

Firstly, thanks for the replies so far
Below are the header and implementation files for "MyViewController";
Questions:
1) In the instance method "viewDidUnload", why is "self" used and not in "dealloc" or for ToggleIsOn in the buttonPressed method ?
I understand what you are saying about "super" in the "dealloc" method.
2) Is it necessary to set the outlets to nil in the "dealloc" method ?
3) Are "viewDidUnload" and "dealloc" correct programmatically speaking ?
//-- MyViewController.h --
#import <UIKit/UIKit.h>
@interface MyViewController : UIViewController
IBOutlet UIButton *myButton;
IBOutlet UILabel *display;
BOOL ToggleIsOn;
float delayTime;
@property (nonatomic, retain) IBOutlet UIButton *myButton;
@property (nonatomic, retain) IBOutlet UILabel *display;
-(IBAction)buttonPressed:(UIButton *)sender;
@end
//-- MyViewController.m --
#import "MyViewController.h"
@implementation MyViewController
@synthesize myButton, display;
-(IBAction)buttonPressed:(UIButton *)sender
UIButton *button = sender;
ToggleIsOn = !ToggleIsOn;
NSLog(@"Button Pressed!");
NSLog(@"Button Tag is %i", button.tag);
NSLog(@"Button State is %i", button.state);
NSLog(@"ToggleIsOn = %i", ToggleIsOn);
display.text = (ToggleIsOn) ? @"Toggle ON" : @"Toggle OFF";
// rest of instance method...
-(void)viewDidUnload
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
self.myButton = nil;
self.display = nil;
-(void)dealloc
[[myButton release]];
myButton = nil;
[[display release]];
display = nil;
[[super dealloc]];
@end

Similar Messages

  • Super wide Zoom and Super telephoto Zoom for 6D without vignette effect

    I have a Canon 6D Full frame camera. And I just bought the 24- 70 L II USM lens. 
    To complete my kit, I'm looking to invest a super wide zoom ( as low as 10 going uptil 22/ 24 mm) and super telephoto above 70 mm going uptil 300 mm (both preferably L series USM, with wide openings along the full focal range) 
    Before I make the purchases I want to be sure which lenses do NOT have the problem of vignetting AT ALL. 
    I am okay with barell distorition on the wide. But vignetting is something I want to totally avoid. 
    All you experienced folks out there, please guide me. Would also appreciate any links to lists that enumerate the same. 
    Alternatively I am also open to using prime lenses, but they are really low on my preference. 
    Appreciate your time and response. 

    In most software that allows you to add in some vignetting, you can also subtract it.  
    Some apps have lens profiles so they know how much vignetting occurs with that specific lens and at various focal lengths.
    But you can also do this manually.  In astro imaging we calls these images "flats".  The purpose of a "flat" is to determine how much vignetting there is in an image so that we can correctly adjust for it using a program like Photoshop.  
    To create a "flat" you would cover the lens with a piece of white translucent fabric.  Put some light on the fabric so that the fabric itself is evenly lit.  This means the view through the camera is basically just an all-white field with no contrast or features.   Then take a photo (it doesn't matter that the camera cannot focus on the fabric.)
    What you'll get is an all-white image typically brighter in center and dimmer toward the edges but the image can be used to measure the lens' specific vignetting (and in the case of a zoom that level of vignetting would vary by focal length.)  The image can be used as a reference image with software to completely eliminate vignetting.
    A photographer would normally not go to such extremes to get a perfectly flat field (lighting wise), but astro-imagers have to do this as a matter of routine.
    Tim Campbell
    5D II, 5D III, 60Da

  • My self and my wife each have a phone on the same vodafone account, i have an iphone 5 with an apple id also ana ipad on the same apple id. My wifes phone is a samsung, but if i buy here an iphone can i attached it to the same apple id.

    My self and my wife each have a phone on the same vodafone account, i have an iphone 5 with an apple id also ana ipad on the same apple id. My wifes phone is a samsung, but if i buy here an iphone can i attached it to the same apple id.

    Yes and No.  yes for sharing music and apps.  No for icloud/facetime/imessage - she should get her own id for that.

  • I just created a new apple id for my self and when i go to update an app it shows my moms email and she wont tell me her password how do i get my email to show up

    i just created a new apple id for my self and when i go to update an app it shows my moms email and she wont tell me her password how do i get my email to show up

    You should have your stuff separate from your mom's. Delete all the apps downloaded or purchased with your mom's Apple ID and download or purchase them with your own Apple ID. Back up files and data first if possible.

  • Fire fox starts by it self and goes to search site all the time please help or it is back to Internet explorer

    fire fox starts by it self and goes to search site all the time please help

    Possible malware infection
    Do a malware check with some malware scanning programs.
    You need to scan with all programs because each program detects different malware.
    Make sure that you update each program to get the latest version of their databases before doing a scan.
    * http://www.malwarebytes.org/mbam.php - Malwarebytes' Anti-Malware
    * http://www.superantispyware.com/ - SuperAntispyware
    * http://www.microsoft.com/windows/products/winfamily/defender/default.mspx - Windows Defender: Home Page
    * http://www.safer-networking.org/en/index.html - Spybot Search & Destroy
    * http://www.lavasoft.com/products/ad_aware_free.php - Ad-Aware Free

  • HT201263 hey guys i forgot the password for my iphone 4S and i keep on trying any passwords but now my iphone has deactivated it self and its asking me the password but i cant remember it and i dont have the last compter it syniced with!!! so what should

    hey guys i forgot the password for my iphone 4S and i keep on trying any passwords but now my iphone has deactivated it self and its asking me the password but i cant remember it and i dont have the last compter it syniced with!!! so what should i do ?

    In your case your only solution is to restore it ( see http://support.apple.com/kb/HT1808 ) and you may need to force it into restore mode to do that.  This will wipe everything off it and reset it as new, without the passcode.  You can then redownload purchased content, buy unless you have a sync'd copy of your contacts and photo's they will be gone.

  • I had all my old home video's and super 8 movies converted to DVD's. Since I will move back to Europe I asked the company to convert them to PAl system.

    I had all my old home video's and super 8 movies converted to DVD's. Since I will move back to Europe I asked the company to convert them to PAl system. I just got all the DVD's for a lot of money, but I can not play any of them on my MAC book.(I think that is because they were burned on zone 1 dvd's and my lap top works with zone 2.
    I wonder how I can make them work on my macbook..? I intended to start editing those movies so I need to be able to play them on my mac. Is there a way to copy them to zone 2 DVD's and or to zone 0 dvd's and where do I get those free zone or zone 1 recordable dvd's?
    ireen 1 min ago

    Welcome to the Apple Community.
    The Apple TV 2 will play all the content in your iTunes library that your Apple TV 1 does. It can no longer sync any of it but can stream it all just as the older model did. Airplay is a different feature that lets you stream from an iPad/iPhone, the Apple TV 2 has Airplay the first didn't.
    You can still sort and search content by genre, it still marks content watched and unwatched and mainly still lets you organise much as the Apple TV 1 did, with one exception. It doesn't do nested folders, so the ability to tag a movie as a show (ie James Bond) and have all the associated movies in a James bond folder has gone and it lists all these movies individually.
    It has a similar situation with TV shows. It will put all TV shows in a series in a folder as the older one did, but the new one lists each series separately whereas the older model would put all the series in one folder.
    Not nesting folders is a bit of a pain with large libraries and whilst I don't like it, it's more or less the only compromise I have to make and of course I get additional features too.

  • My iPhone 5 screen moves its self and opens apps it self how do I fix that?

    My iPhone 5 screen moves its self and opens apps it self how do I fix that?

    Disabled
    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Wrong passcode results in red disabled screen                         
    If recovery mode does not work try DFU mode.                        
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings        
    For how to restore:
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: How to back up     
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store        

  • What's the difference between this and super in this class

    public interface Doggie {
    public void wao();
    public void fetchBall();
    public void run();
    public void sleep();
    public class Kittie {
    public void miao() {
    public void catchRat() {}
    public void run() {}
    public void sleep() {}
    public class KtoD extends Kittie implements Doggie {
    public void wao() {
    this.miao();//here super.miao() will work too,
    //what is the difference between them?
    public void fetchBall() {
    this.catchRat();//here too
    public void run() {
    super.run();
    public void sleep() {
    super.sleep();
    }

    well, just off the top of my head (someone who wants to quote the relevant parts of the JLS can reply here too) - this makes sense, because your KtoD class extends Kittie, which has a miao method. You've not overridden this method, so KtoD's miao method is Kittie's method. Thus, this.miao() and super.miao() refer to the same method. If you had overridden this method in your KtoD class then this.miao() would refer to the overridden miao method, and if you had wanted to call the miao method from Kittie then you would have had to use super.miao()
    Did that answer your question?
    Lee

  • How to display sub and sup HTML tags?

    Hallo,
    I use the htmltext property of the text control a lot for displaying Infotext, but this property can not render then <sub> and <sup> Tags. How can I display Infotext where I need, for example, math formulas within the text flow???
    Thanks
    Hans

    Alex,
    Thanks for this information. This framework should meet a lot of my demands, but for this actual project, it's too complex, I only need this 2 tags additional to the existing, and I substituted the <sub> tag by a <font size='-2'> and the <sup> tag by drawing a spezial character (&#8593;). With this drawing of special characters, I can also do a lot.
    But nevertheless that's the framework I need for future projects!
    Thanks
    Hans

  • Part appraisal document for self and subordinates

    Hi All
    I have created a part appraisal document , for self and sub ordinates. When I logged in to portal , the subordinates are able to view the document whereas document created for self are unable to. For self as well as for subordinates , we have configured the document in ESS only. It may be due to some powl query issue but am unable to identify if its powl issue or some authorization issue,In either case , how to identify the same. Please suggest.
    Thanks
    Smriti

    Hello Smriti,
    Can you clarify the issue for me - you have created one appraisal document and in the header data have defined the part appraisers as the employee and subordinates, and only the employee is unable to access the part appraisal document?
    When you created the appraisal template, on the 'Roles' tab, is the role for 'Self' ticked?
    Can the employee access any of his other appraisal documents from the portal?
    Is IT0105 data maintained for the employee's SY-UNAME?
    Regards,
    Kendall

  • Installing MP,DP and SUP in DMZ for IBCM

    Hi all,
    I would like start installing MP, DP and SUP role in my DMZ to support IBCM. My DMZ is in the same forest but in different and untrusted domain. The primary site and Enterprise Root Certificate (CA) are in the same domain (intranet). An admin account
    has been created in DMZ domain so the above roles can be installed from primary site server. I am still not too sure how I will install Cert that I created on root CA that is on intranet. Do I need to export it from Intranet and import back on the new site
    server in DMZ or use a different method?
    If the question is too confusing then please give your experience as how you have installed certificate on your site server (DMZ) for IBCM?
    Are you using primary server computer account for installing site roles in DMZ or a user account?
    Do I need to publish site information in DMZ domain as well?
    Thanks

    "My DMZ is in the same forest but in different and untrusted domain"
    This is not possible. By definition, all domains in a forest trust each other -- maybe not directly, but they do trust each other.
    Also, the new system in the DMZ will not be a "site server", it will be a site system (sometime called a site system server but not usually). This may seem like semantics, but its very important because "site server" means something very
    specific which the site system in the DMZ is not.
    Deploying certs in the DMZ can be done in one of many ways. You really should get a PKI smart person involved though because it's not ConfigMgr task. There are ways to deploy certs cross-domain and cross-forest using group policy auto-enrollment but these
    take setup and configuration on the PKI side. Alternatively you could use web enrollment on your CA is it is setup and has the proper templates available -- once again, that will take setup and configuration on your PKI. Finally, you could just use the command-line
    assuming the cert templates are accessible for the system in the other domain.
    For your scenario, you should be able to grant the site server's computer account local admin permissions on the DMZ site system. Don't forget about the FSP which can be very valuable for IBCM but will require and additional site system because it must be
    left to listen for HTTP traffic.
    Finally, publishing site information to the domain allows clients to locate the MP on the intranet however your clients won't be on the intranet to use location information, so that wouldn't help much. Additionally, clients use global catalog queries to
    perform their site location so within a forest, there is no need to publish the same informatin to mutliple domains (unless you have multiple sites which you do not).
    Jason | http://blog.configmgrftw.com | @jasonsandys

  • So i have some open work from the night before on my computer and left it on, closed the top, the computer restarted it's self and lost all the work to what was added.....where can i find it....was it auto saved?

    so i have some open work from the night before on my computer and left it on, closed the top, the computer restarted it's self and lost all the work to what was added.....where can i find it....was it auto saved?

    If the application supported auto-save, yes, if not, then no.
    If you were creating a mail message, it might be in the drafts folder of the e-mail program.
    What evidence do you have the computer restarted itself?    Did the Apple logo come up?

  • Yahoo toolbar has installed its self and I cant find a way to remove it

    My homepage is set as Google but Yahoo has installed its self and i prefer google

    '''Try the Firefox SafeMode''' to see how it works there. <br />
    ''A troubleshooting mode, which disables most Add-ons.'' <br />
    ''(If you're not using it, switch to the Default Theme.)''
    * You can open the Firefox 4.0+ SafeMode by holding the '''Shft''' key when you use the Firefox desktop or Start menu shortcut.
    * Or use the Help menu item, click on '''Restart with Add-ons Disabled...''' while Firefox is running. <br />
    ''Don't select anything right now, just use "Continue in SafeMode."''
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before using the Firefox shortcut (without the Shft key) to open it again.''
    '''''If it is good in the Firefox SafeMode''''', your problem is probably caused by an extension, and you need to figure out which one. <br />
    http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes
    ''When you figure out what is causing that, please let us know. It might help other user's who have that problem.''

  • My ipad 2 is all of a sudden opening apps and internet by its self and playing videos by it self and open notes and typing and saving them

    I have had my Ipad 2 for a year now a couple of days ago it started acting all weard like opening notes and typing by it self and opening the internet and searching **** videos i am afraid that someone hase gotten my ipad 2 serial number please help

    If you have not jailbroken your iPad, then no one can be doing anything to it.
    Have you tried restarting it?
    ~Lyssa

Maybe you are looking for