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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:03:23+00:00 2026-05-26T16:03:23+00:00

I am getting warning: Instance method ‘method’ is being used on ‘Class’ which is

  • 0

I am getting warning: Instance method ‘method’ is being used on ‘Class’ which is not in the root class.

I am calling this method (which is defined in the super class) in the static method. When I execute the code, I get runtime error: unrecognized selector sent to class.

Is it possible to solve this problem? Is it possible to call super class method inside the static method?

Thank you

EDIT:

Child class:

@interface ProfileClass : GHAsyncTestCase {}
+ (void)testGHUnitSuccess;
@end

@implementation ProfileClass
+ (void)testGHUnitSuccess {
    [self waitForStatus:kGHUnitWaitStatusSuccess timeout:10.0];
}
@end

GHAsyncTestCase is class from GHUnit framework. Maybe, it is not possible to call the super class method in static method. If not, I will have to solve it in different way.

SOLUTION:

I have created shared instance of my super class and have used it in the static methods.

  • 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-26T16:03:24+00:00Added an answer on May 26, 2026 at 4:03 pm

    Simple answer is no.

    To call an instance method you must have an instance of the class to send the message to. In a static method you do not have an instance of the class.

    Thus you either need to convert the called method to a static method – which should be possible if the method does not depend on any values of the instance or you have to create an instance of the class (alloc, init etc) in the static method.

    We cannot provide a more concrete way out without seeing your code.

    EDIT:
    After your edit it can bee seen what the issue is.
    In a class method (+ (void)testGHUnitSuccess – note not a static method) self is the class which does not have the instance methods.
    Thus as you say you need to replace self by an instance of the class – in this case a shared instance.

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

Sidebar

Related Questions

I am calling a method from another method and keep getting a warning: firstViewController
I'm getting this warning: local declaration of webView hides instance variable -(void)webViewDidFinishLoad:(UIWebView *)webView {
I am getting Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource
I keep getting 'warning: control reaches end of non-void function' with this code: -
I am getting this warning: Use of uninitialized value in eval \string\ at myscript.pl
I am getting this warning from FxCop: 'RestartForm' contains field 'RestartForm.done' that is of
I'm getting a warning: Return makes pointer from integer without a cast for this
I keep getting this as a warning I want to avoid getting this warning
I'm trying to install Rcpp on Ubuntu 10.04 and getting this error (which implies
so i am getting an uncaught exception and im not sure why. this is

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.