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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:49:30+00:00 2026-06-10T05:49:30+00:00

I am stumped, im not very good with Objective-C yet, and I have been

  • 0

I am stumped, im not very good with Objective-C yet, and I have been following tutorials until now.

I have decided to add all the functions I use in multipul views in one “CommonClass” I have called GeneralHelper.

When trying to call my function im getting the following error:

Instance method’-convertPoint:’ not found(return type defaults to
‘id’)

Below is my code:

My GeneralHelper.h lookslike this:
#import

    @interface GeneralHelper : NSObject

    @end

    GeneralHelper* gHelper;

My GeneralHelper.m looks like this:

    #import "GeneralHelper.h"
    #import "WhackGame.h"
    #import "SimpleAudioEngine.h"
    #import "Settings.h"

    @implementation GeneralHelper
    -(CGPoint)convertPoint:(CGPoint)point {
        if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
            return ccp(32 + point.x*2, 64 + point.y*2);
        } else {
            return point;
        }
    }

    @end

Inside my Initialize method I have:

    gHelper = [[GeneralHelper alloc] init]; //First, we create an instance of GeneralHelper

and im trying to call it like:

    mole1.position = [gHelper convertPoint:ccp(85, 85)];

Any ideas?

Thanks

  • 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-10T05:49:32+00:00Added an answer on June 10, 2026 at 5:49 am

    You didn’t declare the method convertPoint: in your @interface like this:

    @interface GeneralHelper : NSObject
    - (CGPoint)convertPoint:(CGPoint)point;
    @end
    

    Also, if you’re trying to have one shared instance of GeneralHelper, that’s not the way to do it. Instead you should have a class method that returns an instance.

    @interface GeneralHelper : NSObject
    - (CGPoint)convertPoint:(CGPoint)point;
    + (GeneralHelper *)sharedHelper;
    @end
    

    Then in your implementation:

    + (GeneralHelper *)sharedHelper
    {
        static GeneralHelper *sharedHelper = nil;
        static dispatch_once_t onceToken;
        dispatch_once(&onceToken, ^{
            sharedHelper = [[GeneralHelper alloc] init];
        });
        return sharedHelper;
    }
    

    And then wherever you need it:

    CGPoint convertedPoint = [[GeneralHelper sharedHelper] convertPoint:point];
    

    Alternatively you could simply use class methods:

    @interface GeneralHelper : NSObject
    + (CGPoint)convertPoint:(CGPoint)point;
    @end
    

    The implementation is the same as before, but with a + instead of a – sign. In this case you don’t need the sharedHelper method and can simply call it like this:

    CGPoint convertedPoint = [GeneralHelper convertPoint:point];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Very Simple one, just stumped on syntax and not finding a good example anywhere.
I have been stumped all day on this problem. Basically I want to check
I have been very stumped by this one. I have a fairly large (~1500
Good morning. I am very new to CSS and been reading up on a
EDIT NOTE: I've not been very clear. I'm trying to start from a single
I'm very new to PHP so far and have been trying to learn it.
I've been porting newlib to my very small kernel, and I'm stumped: whenever I
I have to admit I am COMPLETELY stumped on this one. I've been scouring
I have a very simple problem and I seem to be stumped at whatever
I am stumped. I have been trying to solve this for 2 days and

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.