I can't reply directly to you for some reason (my emails keep getting 
rejected).

The error message gives you some hints. It tells you the types of the two 
view controllers involved as well as the type of the view itself. It also 
gives you the pointer values of each of those. Those are the same values 
that would appear in the "Handle" property of the corresponding object in 
MonoTouch. It looks like it's having trouble with an instance of a 
UITableView (that's the view). That view is somehow getting associated 
with both a UITableViewController (the built in class) as well as and 
instance of SomeTableViewController. Are you somehow reusing a view for 
two different table view controllers? Did you implement LoadView in 
SomeTableViewController and have it fetch the view for another view 
controller? Or maybe you instantiated a UITableViewController in a XIB 
file and then bound its table view to the File's Owner? Check for table 
view in the XIB file being bound to two different View outlets.

I'm just throwing out ideas of possible causes. You'll have to poke around 
a bit to figure it out. If you're desperate then I suggest making a new 
project with a table view controller in iOS 6 (starting from scratch). See 
if you can get that working, building it up to the same type of 
functionality you have in your real code. At some point you may find out 
the difference.
--
Adam Kemp
[email protected]
(512) 683-6058

Mike Murdock <[email protected]> wrote on 09/24/2012 02:31:46 PM:

> From: Mike Murdock <[email protected]>
> To: Adam Kemp <[email protected]>, 
> Date: 09/24/2012 02:31 PM
> Subject: RE: [MonoTouch] UIViewControllerHierarchyInconsistency 
> issue after updating to ios6
> 
> Is there a way to figure out what view controllers/view is 
> associated with other view controllers. I need a way to start 
> debugging this and can't seem to debug what additional view 
> controllers my view is associated with.
> 
> Thanks
> Michael
> 
> -----Original Message-----
> From: [email protected] [mailto:monotouch-
> [email protected]] On Behalf Of Adam Kemp
> Sent: Monday, September 24, 2012 11:46 AM
> To: [email protected]
> Subject: Re: [MonoTouch] UIViewControllerHierarchyInconsistency 
> issue after updating to ios6
> 
> > *         : UIViewControllerHierarchyInconsistency Reason:
> > *             A view can only be associated with at most one view
> > controller at a time!
> 
> This issue is probably more related to iOS 5 than iOS 6. Starting in
> iOS 5 they added the ability to have child view controllers. Prior 
> to iOS 5 you were told never to add a UIViewController's View as a 
> subview of another view (other than the window, of course). If you 
> were careful and lived with certain shortcomings (like lack of 
> notifications for things like rotation notifications) then you could
> get away with it, but it was never really supported. In iOS 5 they 
> provided an official mechanism for doing this. They provided methods
> like AddChildViewController and RemoveFromParentViewController, as 
> well as notification methods Will/DidMoveToParentViewController.
> 
> As part of that change they started to enforce a relationship 
> between the hierarchy of view controllers and the hierarchy of their
> views. That is, if a view controller is a child of another view 
> controller then its view must also be a child of (perhaps 
> indirectly) of the same view controller's view. Likewise, a view 
> controller's view should not be a child (directly or indirectly) of 
> another view controller's view if it is not a child of that view 
> controller itself. This requirement is checked in certain 
> situations, and if they find a violation then they raise that assertion.
> 
> Apparently your code violated that requirement. The solution is to 
> use the new API to tell iOS about the relationship between the view 
> controllers.
> --
> Adam Kemp
> [email protected]
> (512) 683-6058
> _______________________________________________
> MonoTouch mailing list
> [email protected]
> http://lists.ximian.com/mailman/listinfo/monotouch

_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to