Forum Xamarin.iOS

Cannot assign UITabBarController.TabBar.TintColor: Cannot cast from source type to destination type

tbergerontbergeron CAMember
edited November 2013 in Xamarin.iOS


Weirdly enough, doing this works like a charm on all versions of iPhone simulator:

UITabBarController tabBarController = new UITabBarController();
tabBarController.TabBar.TintColor = UIColor.FromRGB(227, 35, 38);

But when ran on a device it crashes because TabBar is freaking out:

I've been trying several things and been looking all over the web for a solution but I cannot seem to make it run on any device (iPad 3, iPhone 5, iPod latest). Anyone has a clue? Please help me.

EDIT: Also is there any better way of getting Xamarin-related help? I mean, most of my questions goes in the void. I'm a week in my trial and there's a few points I'd love to get insight about.

Thanks and have a nice day.


  • SebastienPouliotSebastienPouliot CAXamarin Team Xamurai

    A few people have hit a similar issue but we have not been able to reproduce it. It could be something related to the build itself (e.g. caching) since it's identical across devices.

    Could you:

    1. Make a copy of the solution directory;

    2. Try Clean on your solution and then rebuild it;

    3. If it works it would be nice if you could file a bug report and attach the original copy of your solution. We'll see if we can duplicate it using the same binaries.


  • tbergerontbergeron CAMember
    edited November 2013

    Hi Sebastien and thanks for your reply.

    I tried copying the solution to another directory, cleaned it and executed it on device again and it worked!

    So I guess you are right and this is a bug. I won't attach the original copy of my solution since there's about few hundreds line of code in there but I'm willing to send it to you via private email.

    Any email I could message you to? I compressed the whole solution except the .git sub-directory that contains all my source control stuff. Do you need the bin/* stuff as the archive will weight 150mb+ with them. Just tell me an email and what you want and I'll send it right away.

    EDIT: Also once I archived the solution and sent it to you, is there anything I can clear/trash to get it working on my original solution?

    Thanks a lot! Glad you pointed the finger at the culprit fast like that!

  • SebastienPouliotSebastienPouliot CAXamarin Team Xamurai

    I suspect this is a build caching issue so we'll need everything (except the .git stuff) to see what went wrong.

    You can email me at [email protected] but that might not fit well inside an email (size restriction). Do you have a dropbox account that you could share a temporary link to that archive ?

  • tbergerontbergeron CAMember

    I sure do, I started the upload it shouldn't take long from now.

    As soon as it's done I'll email you with the URL.

    Thanks for the help!

Sign In or Register to comment.