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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:22:13+00:00 2026-06-13T00:22:13+00:00

This is a super-basic question. I want to use a class from Matt Gemmell’s

  • 0

This is a super-basic question. I want to use a class from Matt Gemmell’s MGImageUtilities in my app. I’ve added the classes UIImage+ProportionalFill.h and UIImage+ProportionalFill.m to my project. They define the method imageScaledToFitSize. But when I try to run the app, I get an unrecognized selector sent to instance error. Obviously I have to make the method available to the class in which I want it to run, but I don’t know how to do that. I have #import UIImage+ProportionalFill.h in both the .h and .m files of the view controller, and in the .h file I’ve added

@interface UIImage (ProportionalFill)

- (void)imageScaledToFitSize;

@end

But I’m still getting the error. I assume there’s something very fundamental that I’m failing to do, but I don’t know what it is.

Your thoughts?

UPDATE: My project has the following classes: UIImage+ProportionalFill, ‘GHViewController, and 'GHAppDelegate.UIImage+ProportionalFill` contains the following declaration (and corresponding implementation):

- (UIImage *)imageScaledToFitSize:(CGSize)size;

In GHViewController.m, I have the following code:

    UIImage *img = [self createImage];
    UIImage *pic;
    if (self.serviceType==SLServiceTypeFacebook)
    {
        CGSize size = CGSizeMake((404*320)/([[UIScreen mainScreen] bounds].size.height - 64), 404);
        pic = [img imageScaledToFitSize:size];
    }

That’s the only place I’m calling imageScaledToFitSize.

  • 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-13T00:22:14+00:00Added an answer on June 13, 2026 at 12:22 am

    If you have included the .m file, you should not get the unrecognized selector sent to instance error. So, I suspect that either the .m file was not correctly added to your target, or that you misspelled something when calling the method, or sent it to the wrong object (not an instance of UIImage).

    If you provide more info about the way you are calling the method (i.e., on which object) and the exact console log output, I might be able to help you further.

    To check if the .m file is actually assigned to your target, go to your project info pane in Xcode and show the build phases pane for the target; there you will find a list of all the modules included when building it.

    As a general note:

    1. including the .h file for your category will prevent the compiler from emitting a warning about an undefined method; not including the .h file will not prevent the method from being actually called, if the implementation is available;

    2. if you do not include the .m file you get the exception with the unrecognized selector sent to instance.

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

Sidebar

Related Questions

Forgive this super basic question, from a search newbie. I want to implement a
Sorry, another super basic ASP.NET question. this so embarrassing. I am reading the article
this is a real basic question but i was struggling at it from 30
This is a super basic question (I am brain dead today): How do I
I'm pretty new to Java so sorry if this is super basic. Basically I
Sorry this is probably super basic. But in all my javabean examples, I've not
A simple answer to this super simple question would be great! Here is the
This should be a pretty straightforward classes and interfaces question, but please bear with
My question is super simple, but I'm transitioning from C# to C++, and I
Here’s a really really super-basic question. Say I wanted to build – today –

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.