SetBackgroundColorXC errors 2021r2

I have no idea if this fails in previous XOJO versions using the new compiler. I am just revisiting an iOS app I built using XOJO 2019. Inside that I used the iOSKit-master for XOJO 2020r2. At this time I am just scratching the surface of the provided iOS extensions. This one SetBackgroundColorXC in particular is used in several places and fails here dim myViewPtr As Ptr = decl_GetView(v.Handle)

This is how I call that Method
self.SetBackgroundColorXC(&cB8EFFC00)

Here is the code contained inside that Method inside ViewExtensionsXC

Dim uic As UIKit.UIColor

if c.Alpha = 255 then
  uic = UIKit.UIColor.ClearColor
else
  uic = new UIKit.UIColor(c)
end if



' UIKit Declare to get a reference to a View from its ViewController
Declare Function decl_GetView lib "UIKit.framework" selector "view" (aUIViewController As Ptr) As Ptr
' Here is the corresponding Xojo call (View.Self returns a ViewController)
dim myViewPtr As Ptr = decl_GetView(v.Handle)

' UIKit Declare to set the backgound color of a View
Declare Sub decl_SetBackgroundColor lib "UIKit.framework" selector "setBackgroundColor:" (aUIView As Ptr, aUIColor As Ptr)
' Here is the corresponding Xojo call
decl_SetBackgroundColor(myViewPtr, uic)

Not certain what needs to be changed to that line of code or what else may need to be changed.

What’s the compiler/runtime error when it fails?

There is no error. The debug session ends. I only know the error location because I started setting break points

Is the first parameter in SetBackgroundColorXC

  1. extends v as MobileScreen or
  2. extends v as iOSView?
    And is the calling view/mobileScreen the same class?

Open the Console app and you can see a crash log there. Paste it here

Parameter list in SetBackgroundColorXC is
extends v As iOSView, c As Color

I attempted to change to MobileScreen but I received errors when attempting to run

These calls self.SetBackgroundColorXC(&cC7E9FE00) all receive ‘There is more than one method with this name but this does not match any of the available signatures’ at run time

Here it is
https://gofile.me/5eeN4/dpGKG7Pyv

It seems v.Handle returns a UIView on a UIViewController. so you should just be able to do dim myViewPtr As Ptr = v.Handle I believe

Nice - that was it - thanks

Var uic As UIKit.UIColor

if c.Alpha = 255 then
  uic = UIKit.UIColor.ClearColor
else
  uic = new UIKit.UIColor(c)
end if

' UIKit Declare to get a reference to a View from its ViewController
Declare Function decl_GetView lib "UIKit.framework" selector "view" (aUIViewController As Ptr) As Ptr
' Here is the corresponding Xojo call (View.Self returns a ViewController)
'Var myViewPtr As Ptr = decl_GetView(v.Handle)
Var myViewPtr As Ptr = v.Handle

' UIKit Declare to set the backgound color of a View
Declare Sub decl_SetBackgroundColor lib "UIKit.framework" selector "setBackgroundColor:" (aUIView As Ptr, aUIColor As Ptr)
' Here is the corresponding Xojo call
decl_SetBackgroundColor(myViewPtr, uic)
Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.