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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:09:36+00:00 2026-05-30T11:09:36+00:00

I have a working piece of code in the application delegate that contains a

  • 0

I have a working piece of code in the application delegate that contains a reference to a view that may or may not be created during the course of the use of the app. This code will only be eventually called after the referenced object comes into existence, so there is not possibility of a crash.

However, the compiler detects this reference and give a warning:

warning: Semantic Issue: Instance method
 '-dismissPurchasingViewAndUpdateSetupView' not found (return type
 defaults to 'id')

In a nutshell, this is what is happening:

In application delegate:

@interface appDelegate : NSObject
  {
   NSObject *purchasingView;
  }

  @property (nonatomic, retain) NSObject *purchasingView;
@end

@implementation appDelegate
  @synthesize purchasingView;

-(void)aMethod
{  
  [purchasingView dismissPurchasingViewAndUpdateSetupView];       
}

In a view controller:

-(void) someOtherMethod
{
    //Let the app delegate know about the reference to this view
    appDelegate *appDelegate = (appDelegate *)[[UIApplication sharedApplication] delegate];
    appDelegate.purchasingView = self;
}

-(void)dismissPurchasingViewAndUpdateSetupView
{
    [self dismissModalViewControllerAnimated:YES];
}

The app delegate implements a SKPaymentTransactionObserver and it receives App Store notifications triggered by purchases in the view controller. When a purchase completes the app delegate notifies the view controller to dismiss it self.

Is this a sensible way to do this? Is there a way to get the compiler to ignore the fact that when the app runs for the first time, the purchasingView pointer is pointing to null?

  • 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-30T11:09:38+00:00Added an answer on May 30, 2026 at 11:09 am

    You’re not getting the error because purchasingView may be nil when the application starts.

    You’re getting the error because purchasingView is an NSObject, and NSObject doesn’t implement the -dismissPurchasingViewAndUpdateSetupView method. If you change the type of purchasingView to whatever class it is where you implemented purchasingView, then the error will go away.

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

Sidebar

Related Questions

I have this piece of code in my application. I suspect that it is
I have this piece of code (summarized)... AnsiString working(AnsiString format,...) { va_list argptr; AnsiString
I have been working on some legacy C++ code that uses variable length structures
I have taken a perfectly working MDX piece of code to Windows 2008R2 (all
I have this problem that when there is an OpenGL application I am working
I am working in an ASP.NET MVC Application. I have a view model as
So I have been working on this phone gap application that uses jquery-mobile. Recently,
I'm working on an application for one of our departments that contains medical data.
Let's say you are working on a piece of legacy code that was written
I am working on a Web Forms application and I have some HTML code

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.