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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:25:48+00:00 2026-06-16T15:25:48+00:00

Im new in MonoTouch. I am currently trying to bind an Objective-C library into

  • 0

Im new in MonoTouch. I am currently trying to bind an Objective-C library into MonoTouch, so far I’ve done much of the work, however, i don’t know how to bind the following code :

static inline NSString* UmRet_lookup(UmRet c) {
#define URLOOK(a) case a: return @#a;
switch (c) {
    URLOOK(UMRET_SUCCESS          )
    URLOOK(UMRET_NO_READER        )
    URLOOK(UMRET_SDK_BUSY         )
    URLOOK(UMRET_ALREADY_CONNECTED)
    URLOOK(UMRET_NOT_CONNECTED    )
    URLOOK(UMRET_LOW_VOLUME       )
    URLOOK(UMRET_UF_INVALID_STR   )
    URLOOK(UMRET_UF_NO_FILE       )
    URLOOK(UMRET_UF_INVALID_FILE  )
    default: return @"<unknown code>";
    }
    #undef URLOOK
}

And also the next code :

#define UMLOG_ERROR    @"[UM Error] "
#define UMLOG_WARNING  @"[UM Warning] "
#define UMLOG_INFO     @"[UM Info] "
  • 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-16T15:25:50+00:00Added an answer on June 16, 2026 at 3:25 pm

    You cannot bind this as it’s not really Objective-C code but some C pre-processor directives.

    In such cases you need to rewrite this into C#. This looks to be some translation of error codes into string representation. Depending on your app you might want to use C# strings (instead of NSString).

    static public NSString UmRet_lookup (UmRet c)
    {
       switch (c) {
       case UMRET_SUCCESS : return new NSString ("UMRET_SUCCESS");
       case UMRET_NO_READER : return new NSString ("UMRET_NO_READER");
       case UMRET_SDK_BUSY : return new NSString ("UMRET_SDK_BUSY");
       case UMRET_ALREADY_CONNECTED : return new NSString ("UMRET_ALREADY_CONNECTED");
       case UMRET_NOT_CONNECTED : return new NSString ("UMRET_NOT_CONNECTED");
       case UMRET_LOW_VOLUME : return new NSString ("UMRET_LOW_VOLUME");
       case UMRET_UF_INVALID_STR : return new NSString ("UMRET_UF_INVALID_STR");
       case UMRET_UF_NO_FILE : return new NSString ("UMRET_UF_NO_FILE");
       case UMRET_UF_INVALID_FILE : return new NSString ("UMRET_UF_INVALID_FILE");
       default: return new NSString ("<unknown code>");
       }
    }
    

    The other defines should be converted into C# static, e.g.

    static public NSString UMLOG_ERROR = new NSString ("[UM Error] ");
    static public NSString UMLOG_WARNING = new NSString ("[UM Warning] ");
    static public NSString UMLOG_INFO = new NSString ("[UM Info] ");
    

    Again you might want to use C# string (and turn them into const too).

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

Sidebar

Related Questions

I am new for monoTouch. I have a file called TargetConditions.h in Objective-C. I
I am new to monotouch and wanted to know if there is a simple
i currently trying to get my model loader to work and got a error
Objective C answers are fine too. This is in C# Monotouch. Currently I am
I am new to iPhone developement in general. I am currently using Monotouch (MonoDevelop
I am new to MonoTouch iPhone apps, when i am trying to run Social
I am new to MonoTouch and I am trying to send an email with
Hello i am new to monotouch and i am trying to make an app
I'm new in monotouch and I'm having a problem using NavigationViewController: In the FinishedLauching
new to c#. I'm trying to make a simple system where I can search

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.