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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:58:52+00:00 2026-05-22T02:58:52+00:00

I have encountered a problem where the reflection method GetMethod is not returning a

  • 0

I have encountered a problem where the reflection method GetMethod is not returning a static method for a class. This is only going wrong on an actual iphone; on the simulator it is working correctly. I have tried the following:

MethodInfo methInfo = _type.GetMethod (methodName);

and

MethodInfo methInfo = _type.GetMethod (methodName, System.Reflection.BindingFlags.Static);

but neither of these return the method specified in methodName. The specified method does exist as shown by the fact that it works on the simulator. I have confirmed with the debugger that my member variable _type does contain the correct class type reference. The methods that I am trying to retrieve are declared as public in the class.

Has anyone encountered this before or know why this would work on the simulator but not on the actual iphone?

  • 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-22T02:58:53+00:00Added an answer on May 22, 2026 at 2:58 am

    Reflection, although not fully operational on iOS, works. The problem is that the linker is activated on the configuration for the device and is cutting off the method since it is not being used. The linker cannot “see” reflection calls.

    If it is a custom object, decorate it with the PreserveAttribute:

    [Preserve(AllMembers=true)]
    public class MyClass
    {}
    

    If it is an object from the SDK, you have two choices:

    1. Disable the linker completely. This is not good since the final size will be big.
    2. Use the method once in your code directly so that the linker will know it is there and will not strip it.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have encountered this problem a few times, and am not able to figure
I have encountered a problem that I have not come accross yet when setting
I am writing a class. I have encountered the problem in the title. Here
I have encountered this problem: Depending on numbers from I want to create a
i am getting started with zend framework.I have encountered this problem with forms. when
I have encountered a problem twice now whereby a producer thread produces N work
I have encountered a problem of placing data into the Table View. Here is
I have encountered a problem in my application. I have two forms, one that
I'm migrating a TSQL stored procedure to PL/SQL and have encountered a problem -
I am using ajaxForm. Now I have encountered a problem. My idea is when

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.