Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS: This PlotModel is already in use by some other PlotView control. #144

Open
janusw opened this issue Jan 16, 2023 · 0 comments
Open
Labels

Comments

@janusw
Copy link
Member

janusw commented Jan 16, 2023

This is similar to #139, but on iOS ...

Apparently the exceptions regarding "This PlotModel is already in use ..." do not only occur on MacOS, but sometimes also on iOS (although I don't quite understand under which circumstances this happens yet).

The following stack trace is from an application that uses a PlotView inside a TableView:

    IPlotModel.AttachPlotView (OxyPlot.IPlotView plotView)
    PlotView.set_Model (OxyPlot.PlotModel value)
    PlotViewRenderer.OnElementChanged (Xamarin.Forms.Platform.iOS.ElementChangedEventArgs`1[TElement] e)
    VisualElementRenderer`1[TElement].SetElement (TElement element)
    IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element)
    Platform.CreateRenderer (Xamarin.Forms.VisualElement element)
    ViewCellRenderer+ViewTableCell.GetNewRenderer ()
    ViewCellRenderer+ViewTableCell.UpdateCell (Xamarin.Forms.ViewCell cell)
    ViewCellRenderer+ViewTableCell.set_ViewCell (Xamarin.Forms.ViewCell value)
    ViewCellRenderer.GetCell (Xamarin.Forms.Cell item, UIKit.UITableViewCell reusableCell, UIKit.UITableView tv)
    CellTableViewCell.GetNativeCell (UIKit.UITableView tableView, Xamarin.Forms.Cell cell, System.Boolean recycleCells, System.String templateId)
    TableViewModelRenderer.GetCell (UIKit.UITableView tableView, Foundation.NSIndexPath indexPath)
    (wrapper managed-to-native) UIKit.UIApplication.xamarin_UIApplicationMain(int,string[],intptr,intptr,intptr&)
    UIApplication.UIApplicationMain (System.Int32 argc, System.String[] argv, System.IntPtr principalClassName, System.IntPtr delegateClassName)
    UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName)
    Application.Main (System.String[] args)

I have only seen this happen with 2.0.0-beta.1 so far, but it probably also happens with 2.0.0 and 2.1.0 (?).

@janusw janusw added the iOS label Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant