objective c - C-callback without class pointer -
in app use javascriptcore
api install js function in webview context c callback in cocoa class. there no way can pass callback userdata
/refcon
pointer know class callback belongs to.
is there way resolve without passing pointer? globals don't seem work since overwritten other class instances.
if global won't work (because of multiple / concurrent calls, likely), need kind of context info.
if api returns kind of unique identifier -- session #, allocated struct, -- set nsmaptable maps between identifier , whatever objective-c goop might need.
Comments
Post a Comment