-
Notifications
You must be signed in to change notification settings - Fork 514
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
Carplay - ios 14 Broken feature. CPListImageRowItem can't be used in CPListSection #9996
Comments
So according to this the definition is:
This code compiles in ObjC:
this code fails to compiler in C#:
with
|
I am also encountering this issue. Is there a workaround available @rolfbjarne @chamons ? Thanks! |
There is no great work around available, since the class hierarchy is wrong in C#. A possible work around would be something like this:
which compiles (and doesn't crash), but I don't have a CarPlay test app to test it. What we are doing is using a low level API (GetINativeObject) along with forced_type, which tells our runtime "I know exactly what I'm doing, trust me ™️". This is in general dangerous, because if you are wrong you'll get a native object running around in a managed object that doesn't match, and the first invocation may crash. However, in this case it should be safe, I think. Thoughts @rolfbjarne? Am I missing something here? |
@chamons that's all correct! |
@chamons Thanks so much, it works! |
Hmm,
This is my code:
The signature of |
Hmm, that exception suggests that you have a CPListItem that is being Is that the only location you have a GetINativeObject call in your code base? Without a sample showing the issue, it will be difficult to track this down. |
Hi @ghost. We have added the "need-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
Also, in the future this really should have been a new issue. |
Hi @ghost. Due to inactivity, we will be closing this issue. Please feel free to re-open this issue if the issue persists. For enhanced visibility, if over 7 days have passed, please open a new issue and link this issue there. Thank you. |
…of CPListSection
As discussed in #9996 the CPListSection constructors are not fully correct, since the CPListImageRowItem can't be added to it, which is possible in the native iOS SDK. This PR fixes that. With that, also #15622 seems to be fixed. Co-authored-by: Manuel de la Pena <mandel@microsoft.com> Co-authored-by: Alex Soto <alex@alexsoto.me> Co-authored-by: Chris Hamons <chris.hamons@xamarin.com> Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
In the carplay framework, it's impossible to use the new CPListImageRowItem from ios 14 with the current version of xamarin-ios-14.2.0.12.
In the Apple ios api, the init function for CPListSection is (NSArray<id> *)items;
Both CPListItem and CPListImageRowItem implements CPListTemplateItem via CPSelectableListItem, but the Xamarin API doesn't allow CPListTemplateItem in the constructor.
Actual Behavior
In Xamarin, CPListSection constructor is takes a CPListItem [] items, but CPListImageRowItem doesn't inherit from this interface.
Both CPListItem and CPListImageRowItem have the CPSelectableListItem interface.
We can't create a CPListSection with CPListImageRowItem
Expected Behavior
We should be able to create CPListSection with CPListTemplateItem. The binding should probably be change to make
CPListSection constructor take an array of CPListTemplateItem instead of CPListItem
Workaround
#9996 (comment)
The text was updated successfully, but these errors were encountered: