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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:00:25+00:00 2026-05-21T04:00:25+00:00

In MonoTouch, there are many examples out there where people load NIB files like

  • 0

In MonoTouch, there are many examples out there where people load NIB files like this:

var customController = new MyCustomController();
NSBundle.MainBundle.LoadNib("MyCustomController", customController, null);

Based on many code samples I have seen on blog posts, people tend to do this for custom UITableViewCells which they have designed in Interface Builder.

That is all well and good – but perhaps the NIB file contains more than one custom UITableViewCell. I have found a blog post that shows a single NIB file being used that contains multiple custom table cells (in Objective-C):
http://pegolon.wordpress.com/2008/11/15/using-uitableviewcell-with-interfacebuilder/

That is doing what I want!

In that Objective-C example, it becomes clear that NSBundle.MainBundle.LoadNib actually returns something (an NSArray) and then the returned object is iterated over: each object in the NSArray is a table cell “template”.

When I try to do this in MonoTouch/C#, I am struggling to iterate over the returned NSArray. It doesn’t let me access its contents with array indexers, and it won’t let me loop over it.

How can I do it?

  • 1 1 Answer
  • 1 View
  • 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-21T04:00:26+00:00Added an answer on May 21, 2026 at 4:00 am

    Ok, I have managed to get it working. The important thing is how to get objects from an NSArray:

    NSArray nsArr = NSBundle.MainBundle.LoadNib("MyCustomController", customController, null);
    UITableViewCell = (UITableViewCell)Runtime.GetNSObject(nsArr.ValueAt(0)); // gets the first item
    

    I have also created a sample project and article about how to use custom table cells from nib files:

    Custom Table Cells in MonoTouch

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

Sidebar

Related Questions

This question is a duplicate of 1042830 , but MonoTouch-specific. Is there a way
I am new to monotouch and wanted to know if there is a simple
There are numerous examples of how to do this in native Objective-C but I
I'm trying to call EWS from MonoTouch like in this snippet: byte[] bytes =
I'm using Monotouch to develop an iPhone application. I'm aware there are answers out
Did anyone tried out to use nHibernate with monotouch framework? Are there any issues
Is there any migration analysers available for MonoTouch ? I have seen one for
I'm doing an MonoTouch application and I would like to apply a theme. (So
I'm new in monotouch and I'm having a problem using NavigationViewController: In the FinishedLauching
I am new for monoTouch. I have a file called TargetConditions.h in Objective-C. I

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.