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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:25:04+00:00 2026-06-06T21:25:04+00:00

This code is from Utility app, added by Apple when creating a project. What’s

  • 0

This code is from Utility app, added by Apple when creating a project.

What’s the difference between this:

- (void)flipsideViewControllerDidFinish:(FlipsideViewController *)controller
{
    [self dismissModalViewControllerAnimated:YES];
}

And this:

- (void)flipsideViewControllerDidFinish:(FlipsideViewController *)controller
{
    [controller dismissModalViewControllerAnimated:YES];
}

They both work, but the first one is the main code from Utility app, added by Apple.
So is there any difference, and why does self works? self is MainViewController, not FlipsideViewController. I have no idea, does it has something to do with delegation?
Thank you.

  • 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-06T21:25:07+00:00Added an answer on June 6, 2026 at 9:25 pm

    It all depends on which object is executing flipsideViewControllerDidFinish; if it is the same as the controller, then it is just the same.

    In practice, what happens is that sometimes the class that is delegating (in your case FlipsideViewController), also implements the delegate protocol (ie., acts as a delegate). In such case, self and controller are the same. This would correspond to a delegate intialization (eg. in the init method) like:

     self.delegate = self;
    

    But you could have your delegate be a different class (eg., the application delegate, or whatever) and in this case they would be different. In this case you would say (eg in init):

    self.delegate = [UIApplication sharedApplication].delegate;
    

    In this case, you application delegate would receive the call to FlipsideViewController and the controller argument tells which object it refers to; in this case, self != controller.

    Another case is when your delegate is acting as a delegate for more than one object; in this case, the controller argument tells which object is the delegating one.

    In practice, within the delegate method implementation you can safely use the controller argument without much thinking.

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

Sidebar

Related Questions

This is unmodified code from Apple's iPhone 'Utility Aplication' template: - (void)applicationDidFinishLaunching:(UIApplication *)application {
I run zip utility from my app to create archive. Code similar to the
Borrowing this code from several different tutorials on how to use Google maps on
In this code (from the WCF REST starterkit - preview2): protected override SampleItem OnAddItem(SampleItem
I got this code from our frontend guy for headings: <h2 class=headline><span>Foobar</span></h2> The span
I picked up this code from a msdn blog : #include <windows.h> #include <stdio.h>
I am using this code from css tips and tricks to cover a background
i have this code from a tutorial: // Do the search and show the
I got this code from the wordpress <head profile=http://gmpg.org/xfn/11> What does this means? what
I copied this code from an example . I've read it 100 times. Array.prototype.map

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.