GithubHelp home page GithubHelp logo

Comments (6)

sbooth avatar sbooth commented on May 27, 2024

I haven't yet used ARC, but I think you can work around this problem by using objc_unretainedObject and objc_unretainedPointer:

// To set the callback
decoder->SetDecodingStartedCallback(decodingStarted, objc_unretainedPointer(self));
// In the callback
id me = objc_unretainedObject(context);

from sfbaudioengine.

indragiek avatar indragiek commented on May 27, 2024

Thanks for the reply, using objc_unretainedObject gives me "Cannot initialize a parameter of type 'void *' with an rvalue of type 'objc_objectptr_t'"

from sfbaudioengine.

sbooth avatar sbooth commented on May 27, 2024

Until Xcode 4.2 is officially released I don't think I'll be much help with this, because I don't have it installed yet.

from sfbaudioengine.

sbooth avatar sbooth commented on May 27, 2024

One other thought- objc_objectptr_t is a typedef for const void *. Did you try explicitly casting context to const void * in the call to objc_unretainedObject?

from sfbaudioengine.

sbooth avatar sbooth commented on May 27, 2024

Yet another idea, and I think this may be the correct answer:

// To set the callback
decoder->SetDecodingStartedCallback(decodingStarted, (__bridge void *)self);
// In the callback
id me = (__bridge id)context;

from sfbaudioengine.

indragiek avatar indragiek commented on May 27, 2024

The last solution seems to have done the trick :) This might be worth a note in the README.

from sfbaudioengine.

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.