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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:17:49+00:00 2026-05-28T04:17:49+00:00

We have an app in the appstore that works without any issues on iPhone

  • 0

We have an app in the appstore that works without any issues on iPhone 4g/4gs but when I tested it on an iPod I got a surprise because it crashes all the time at “random” places. Looking at the strack traces it seems my viewcontrollers have been GC’ed.

Will the viewcontroller be garbagecollected if I write methods like this:

public void PushShowTeamController (Object a)
{
  var teamController = new TeamController (a);
  NavigationController.PushViewController (teamController, true);
}

Because the iPod suddently throws an error like this:

 Jan  6 18:52:09 unknown MyApp[5197] <Warning>: Received memory warning.
 Jan  6 18:52:10 unknown UIKitApplication:mypackage.app[0x9db2][5197] <Notice>: Unhandled Exception: System.Exception: Selector invoked from objective-c on a managed object that has been GC'ed ---> System.MissingMethodException: No constructor found for MyApp.TeamController::.ctor(System.IntPtr)
 Jan  6 18:52:10 unknown UIKitApplication:mypackage.app[0x9db2][5197] <Notice>:   at System.Activator.CreateInstance (System.Type type, BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) [0x00000] in <filename unknown>:0 
 Jan  6 18:52:10 unknown UIKitApplication:mypackage.app[0x9db2][5197] <Notice>:   at System.Activator.CreateInstance (System.Type type, System.Object[] args, System.Object[] activationAttributes) [0x00000] in <filename unknown>:0 
 Jan  6 18:52:10 unknown UIKitApplication:mypackage.app[0x9db2][5197] <Notice>:   at System.Activator.CreateInstance (System.Type type, System.Object[] args) [0x00000] in <filename unknown>:0 
 Jan  6 18:52:10 unknown UIKitApplication:mypackage.app[0x9db2][5197] <Notice>:   at MonoTouch.ObjCRuntime.Runtime.ConstructNSObject (IntPtr ptr, IntPtr klass) [0x00000] in <filename unknown>:0 
 Jan  6 18:52:10 unknown UIKitApplication:mypackage.app[0x9db2][5197] <Notice>:   --- End of inner exception stack trace ---
  • 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-05-28T04:17:50+00:00Added an answer on May 28, 2026 at 4:17 am

    This will happen when an managed object is disposed (when no reference is left to an instance) and the object is later resurfaced by native code.

    You need to ensure that a reference to MyApp.TeamController is kept in managed code as long as it can be required (e.g. accessed) by native code.

    In most case MonoTouch will ensure a reference is kept. Your code:

    NavigationController.PushViewController (teamController, true);
    

    is correct and UINavigationController will keep a reference to your teamController. However if you call PushViewController on another controller then the first reference will be overwritten and will be collectable by the garbage collector (GC). This situation would lead to the exception you are seeing.

    Note: because you can’t predict when the GC will collect unreferenced object instance the exception will appear to be thrown randomly.

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

Sidebar

Related Questions

I have just got my first app on AppStore but realise that I should
OK I have app for iPad that reads magazines. All previous issues works fine.
have an app that finds your GPS location successfully, but I need to be
I currently have an iPhone app in the iTunes app store that uses a
I have been working on a Core Data iOS app that works perfectly through
I have an app leveraging Core Data SQLITE3 that works perfectly in the simulator.
I've got a problem with an app that works perfectly in the simulator as
I have an app that works fine in the debug mode on the device.
I've submitted my first iPhone App to the AppStore (on 10.09.10) and I have
I already have an iPhone application (version 1.0) available in the App Store and

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.