Coder Social home page Coder Social logo

Comments (4)

jmsaunders-ms avatar jmsaunders-ms commented on May 18, 2024

We haven't seen issues involving bridged casts. Are you positive you have ARC enabled?

How did you set your project up? Is it imported? (Perhaps ARC settings aren't being preserved) If it's just some code you added after enabling ObjC support in MSVC then you can enable ARC per-file or per-project in the settings dialog.

Can I get a compiler log of the error you're seeing?

from winobjc.

TorreyBetts avatar TorreyBetts commented on May 18, 2024

I created a project this morning to demonstrate the issue. Also, this project was imported using vsimporter. Here's the VS log when attempting to build.

1>------ Build started: Project: WinObjC_Issue33 (WinObjC_Issue33\WinObjC_Issue33), Configuration: Debug Win32 ------
1>  ConsumeRuntimeComponent.cpp
1>  ..\..\WinObjC_Issue33\main.m
1>  ..\..\WinObjC_Issue33\AppDelegate.m
1>  ..\..\WinObjC_Issue33\ViewController.m
1>C:\winobjc\samples\WinObjC_Issue33\WinObjC_Issue33\ViewController.m(71,27): error : incompatible types casting 'CGPathRef' (aka 'id') to 'id' with a __bridge cast
1>C:\winobjc\samples\WinObjC_Issue33\WinObjC_Issue33\ViewController.m(72,25): error : incompatible types casting 'CGPathRef' (aka 'id') to 'id' with a __bridge cast
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========

Project can be downloaded here: https://www.dropbox.com/s/5hcvs7m6s15d4g9/WinObjC_Issue33.zip?dl=0

from winobjc.

jmsaunders-ms avatar jmsaunders-ms commented on May 18, 2024

Thanks for the example.

The reason this is happening is because the iOS version of CGPathRef is a struct*, a C type. Our version is an id, which means no bridge cast is necessary in this circumstance (you can't bridge cast from id to id - in fact you don't have to).

This is a bug in our code. Unfortunately our CGPathRef is an Objective C class called CGPath that has a few convenience methods on it. It should be a C struct with only state. This will be the case for some other Ref types as well (CGFont for example) but we've fixed up most of them already.

We're working on it! Sorry again.

from winobjc.

nicholasgerard-msft avatar nicholasgerard-msft commented on May 18, 2024

@TorreyBetts This issue should be fixed with newer versions of the bridge. Could you please check with the latest release and close the issue if it is resolved?

from winobjc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.