Created
June 3, 2015 00:52
-
-
Save oleavr/47d02312ea5676677a53 to your computer and use it in GitHub Desktop.
ObjC class creation API draft 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const NSAutoreleasePool = ObjC.classes.NSAutoreleasePool; | |
const pool = NSAutoreleasePool.alloc().init(); | |
const MyConnectionDelegateProxy = ObjC.registerClass({ | |
name: 'MyConnectionDelegateProxy', | |
protocols: [ObjC.protocols.NSURLConnectionDelegate, ObjC.protocols.NSURLConnectionDataDelegate], | |
methods: { | |
'- connection:didReceiveResponse:': { | |
retType: 'void', | |
argTypes: ['object', 'object'], | |
implementation: function (connection, response) { | |
console.log('- connection:didReceiveResponse'); | |
console.log('connection=' + connection); | |
console.log('response=' + response); | |
} | |
} | |
} | |
}); | |
const proxy = MyConnectionDelegateProxy.alloc().init(); | |
pool.release(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment