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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:18:09+00:00 2026-06-14T07:18:09+00:00

I have 2 classes. 1st one is Label, another one is LabelGestureRecognizer. In the

  • 0

I have 2 classes. 1st one is Label, another one is LabelGestureRecognizer. In the LabelGestureRecognizer have a method called getName, and i want call the method through the Label class.

Below is a simple example of my problem.
I am trying to call the method ‘getName’, but I am getting an error saying:
“No visible @interface for ‘LabelGestureRecognizer’ declares the selector ‘getName:’”

ViewController.h:

@property (nonatomic, strong) UILabel *valueLabel;

ViewController.m:

- (void)viewDidLoad
{
    valueLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 366, 320, 50)];
    valueLabel.textAlignment = UITextAlignmentCenter;
    valueLabel.backgroundColor = [UIColor lightGrayColor];
    [self.view addSubview:valueLabel]; 
}

- (void) wheelDidChangeValue:(NSString *) newValue {
    self.valueLabel.text = newValue;
}

Label.h:

@protocol LabelDelegate <NSObject> 
@required
 -(void) wheelDidChangeValue:(NSString *) newValue;
@end

@class LabelGestureRecognizer;

LabelGestureRecognizer.m:

- (NSString *) getName:(int) position
{
    NSString *resultat = @"";
    switch (position) {
        case 0:
            resultat = @"Test 1";
            break;
        case 1:
            resultat = @"Test 2";
            break;
        default:
            break;
    }
    return resultat;
}

LabelGestureRecognizer.h:

 @interface LabelGestureRecognizer : UIGestureRecognizer
 {
     NSDate *previous;
     double current;
 }

Label.m:

 LabelGestureRecognizer *recognizer = [[LabelGestureRecognizer alloc] init];
 [self.delegate wheelDidChangeValue:[self getName:0]];
  • 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-14T07:18:10+00:00Added an answer on June 14, 2026 at 7:18 am

    When you are using self in Label.m, that represents the current class object. If you need to represent LabelGestureRecognizer object, you need to use that in place of self as,

    [self.delegate wheelDidChangeValue:[recognizer getName:0]];
    

    Also you should declare the following in your LabelGestureRecognizer.h file as,

    @interface LabelGestureRecognizer : UIGestureRecognizer
     {
         NSDate *previous;
         double current;
     }
    - (NSString *) getName:(int) position;
    @end
    

    Your error message is saying that it is not able to see the declaration of getName method in LabelGestureRecognizer.h class file.

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

Sidebar

Related Questions

I have two classes which extend Activity and need to call another class method
I have an application that fires 2 threads, the 1st launches another class to
In my Android project I have 3 classes: 1st a List class contains a
I have two classes - one base class and one derived from it :
I have classes structured like this: Public MustInherit Class A ' several properties End
Say I have classes class A{ //code for class A } class B{ //code
I have a situation where i have classes JobDescription and Image . I want
If I have classes of Type A and B: public class A { public
I have created 3 partial classes and i want all of them to be
I have classes public class FooKeyedCollection : KeyedCollection<FooType,Foo> { } public enum FooType {

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.