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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:18:13+00:00 2026-06-16T20:18:13+00:00

I’m binding a ObjC library and it all works well, but I have one

  • 0

I’m binding a ObjC library and it all works well, but I have one problem.
The ObjC library is using some values that are defined in a separate header.

For example, a header with:

#define SOME_PROPERTY_1 TRUE
#define SOME_PROPERTY_2 TRUE
#define SOME_PROPERTY_3 FALSE

Dependant on these properties, the library will make some changes to the view (so these changes are in the library, not in my C# code).

I would like to have access to these properties from my C# code so that I can change them. Now I need to build my library again if I want to change them and I can’t change them dynamically (what the goal is).

Is this possible?

I have searched on this, but I didn’t understand the two proposed solutions:

  1. Putting them in my C# code instead of in my binding
    -> I assume this is not a solution, because in that case the library will not know about these changes? (no connection)
  2. Binding them as (static) properties

Unfortunately, I don’t know how to do this. In this header, these is no Class/Interface, only #DEF statements, so I don’t know in which ‘class’ I should define these properties.

The header is then included in some other ObjC classes. I was trying to see if I could define them there, but it’s an interface and properties are not accepted.

So basically, there is a “SomeController” class that I’m binding and the “SomeController.h” is defined as interface

@interface SomeController : UIViewController

And in the “SomeController.m” you then have

#import "Constants.h" //The file with only #DEF statements
@implementation SomeController
{
...
}

Any ideas?

Regards,
Matt

  • 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-16T20:18:14+00:00Added an answer on June 16, 2026 at 8:18 pm

    This is not possible, because your SOME_PROPERTY_# aren’t actually variables, they’re preprocessing directives.

    This means that the ObjectiveC preprocessor will replace all instances of SOME_PROPERTY_# in your source code with the value you defined it to be, but there is no SOME_PROPERTY_# variable/constant in the final executable.

    For example:

    #define SOME_PROPERTY_1 TRUE
    void foo ()
    {
        Bool value = SOME_PROPERTY_1;
    }
    

    will be converted to this by the preprocessor:

    void foo ()
    {
        Bool value = TRUE;
    }
    

    As you can see there is no SOME_PROPERTY_1 in the converted source code.

    This means that you can’t change the value of SOME_PROPERTY_# dynamically.

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

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a small JavaScript validation script that validates inputs based on Regex. I
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I have a text area in my form which accepts all possible characters from
I have been unable to fix a problem with Java Unicode and encoding. The
I have thousands of HTML files to process using Groovy/Java and I need to

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.