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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:29:46+00:00 2026-06-01T05:29:46+00:00

I’m drawing a table view in MonoTouch by subclassing UITableViewController and UITableViewSource (not UITableViewDataSource

  • 0

I’m drawing a table view in MonoTouch by subclassing UITableViewController and UITableViewSource (not UITableViewDataSource!!!). In the constructor of my view controller, I set the table view source like that:

TableView.Source = new CustomTableViewSource();

And in my CustomTableViewSource, I’m constructing the cell of the table view. It’s work great except when I am simulating a memory warning in the iPhone simulator. If the view is hidden (e.g. an other view controller in the tab bar is selected), when I come back, the table view is just blank (white background, no table view anymore).

However, I’m doing nothing in the DidReceiveMemoryWarning callback. I also tried to set again the TableViewSource in the viewWillAppear (if received a memory warning) but no no more success…

Is it a garbage collector issue? I know that GC.Collect is called when receiving memory warning. Maybe the Garbage collector is just throwing away my view and I need to display it entirely again?

  • 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-01T05:29:48+00:00Added an answer on June 1, 2026 at 5:29 am

    You should be initializing the table source in the ViewDidLoad method and not in the constructor. That method is called when a view controller is loaded and then every time the controller’s view needs to be re-created after a memory warning.

    I’ve done some tests and I get similar results after a memory warning. However, I only get an empty table view. When I set the table source in the ViewWillAppear again, the table is populated with data normally.

    The fact that your implementation in the ViewWillAppear does not work, makes me think that the method does not even get called. If that is the case, I am guessing that your table view is not being re-created when it needs to.

    This can happen under certain circumstances when you are using controllers whose views are not created from a XIB file. In this case, you should create the view in the LoadView method (without calling base.LoadView()):

    public override void LoadView()
    {
        this.View = new UITableView(UIScreen.MainScreen.ApplicationFrame); //or something similar
    }
    

    I had similar problems (table views where not re-created) with a complex hierarchy of tab controllers that contained navigation controllers, that contained view controllers etc. The problems were solved when I provided the LoadView method.

    I’m out of guesses 😉

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I am trying to render a haml file in a javascript response like so:
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;

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.