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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:36:14+00:00 2026-06-10T14:36:14+00:00

MonoTouch 5.2.13 I’m using a native ObjectiveC library via MonoTouch bindings. The library exposes

  • 0

MonoTouch 5.2.13

I’m using a native ObjectiveC library via MonoTouch bindings. The library exposes a view controller. All is working fine, until I subclass the view controller. Then, I get NULL reference exceptions or part of the UI is not shown.

I have read about the problems with the btouch tool and the “-e” option. But from what I can see, the option is not present:

Tool /Developer/MonoTouch/usr/bin/btouch execution started with
arguments: /d:DEBUG ApiDefinition.cs /s:StructsAndEnums.cs
/tmpdir:obj/Debug/ios/ /sourceonly:obj/Debug/ios//sources.list

The subclass does (in this example) not add any functionality, but using it is enough to break the binding:

// Works.
var contr = new NativeController();

// Fails with various errors. Throws a NULL reference exception about some UIPopoverController being NULL, for instance.
public class SubclassedController : NativeController
{
  public SubclassedController() : base()
  {
  }
}

var contr = new SubclassedController();

I figured out that adding the [NullAllowed] to a property solved the NULL reference exception.

The native controller exposes a property (nonatomic, strong) UIPopoverController *popoverController. This was bound as UIPopoverController PopoveController {get; set;} – adding the NullAllowed here solved the issue.

But now I’m facing issues with images not showing up and there is no obvious exception.

I assume these problems also derive from the fact that something is NULL when using the subclassed version but the native code seems to react on the NULL and handles it gracefully.

This leads to three questions:

  • Why is the behavior different when using subclassing? What is MonoTouch doing to make this happen? Why do I get a NULL ref in the case I use a derived class? I’m not touching the UIPopoverController an either case.
  • How can I find out what is wrong and how to fix it if there is no error?
  • What else has to be taken care of, besides the NullAllowed?
  • 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-10T14:36:16+00:00Added an answer on June 10, 2026 at 2:36 pm

    This specific issue turned out to be two things:

    • A missing NullAllowed attribute for a UIPopoverController
    • A bug in MonoTouch 5.2.13 that is not related to binding but something else that has to do with CocoaTouch. The specific reason is unknown.

    Everything is working as expected with MonoTouch 5.3.6

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

Sidebar

Related Questions

Note: Using Monotouch. I have a directory called Images where I have all my
Note: Using Monotouch and doing all the UI Programatically. Hello everybody, I have a
In Monotouch 5, I no longer see the option of iPhone View with Controller
I am using monotouch dialog to generate a view. I managed to change the
I'm new in monotouch and I'm having a problem using NavigationViewController: In the FinishedLauching
I have a MonoTouch project which builds and runs fine on i386/iOS Simulator. The
I am building a Monotouch application which downloads data from the server encrypted using
MonoTouch preferred, but Obj-C ok too My MainWindow.xib has a NavigationView and a View.
Working with MonoTouch .NET for iPhone and SQLite on Mac OSX. I can read
When i first started using monotouch i found a page with some code samples

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.