{"action":"created","issue":{"url":"https://api.github.com/repos/mkiol/GNotifier/issues/42","labels_url":"https://api.github.com/repos/mkiol/GNotifier/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/mkiol/GNotifier/issues/42/comments","events_url":"https://api.github.com/repos/mkiol/GNotifier/issues/42/events","html_url":"https://github.com/mkiol/GNotifier/issues/42","id":54359074,"number":42,"title":"encoding parameter of class_addMethod is wrong","user":{"login":"Noitidart","id":6372489,"avatar_url":"https://avatars.githubusercontent.com/u/6372489?v=3","gravatar_id":"","url":"https://api.github.com/users/Noitidart","html_url":"https://github.com/Noitidart","followers_url":"https://api.github.com/users/Noitidart/followers","following_url":"https://api.github.com/users/Noitidart/following{/other_user}","gists_url":"https://api.github.com/users/Noitidart/gists{/gist_id}","starred_url":"https://api.github.com/users/Noitidart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Noitidart/subscriptions","organizations_url":"https://api.github.com/users/Noitidart/orgs","repos_url":"https://api.github.com/users/Noitidart/repos","events_url":"https://api.github.com/users/Noitidart/events{/privacy}","received_events_url":"https://api.github.com/users/Noitidart/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-01-14T18:40:02Z","updated_at":"2015-02-04T09:33:41Z","closed_at":"2015-02-04T08:59:18Z","body":"Hi there,\r\nI was learning objc in jsctypes and thanks to help and discussion from [@arai-a](https://github.com/arai-a) we think that the `class_addMethod` implementation here last argument is wrong.\r\n\r\nWe think that the encoding should be:\r\n\r\n> so our conclusion is that we have to have a minimum of 3 chars so in summary: first char is return. second is the first arg for C which is always `id`, and third char is second arg of C which is always `sel`. and then the characters following are the 1st,2nd,3rd,nth objc args \r\n\r\nSo the code here: [](https://github.com/mkiol/GNotifier/blob/06dad9814d2ac842c359152950b1122874aff2b2/lib/osx.js#L93)\r\n\r\nshould change from:\r\n``` javascript\r\nlet r = class_addMethod( delegate, shouldPresentNotification, callback, \"{NSUserNotification=#}\");\r\n```\r\nto\r\n``` javascript\r\nlet r = class_addMethod( delegate, shouldPresentNotification, callback, \"B@:@\");\r\n```\r\n\r\nWhat were your thoughts when you thought to use `{NSUserNotification=#}`, your thoughts would help us all learn :)"},"comment":{"url":"https://api.github.com/repos/mkiol/GNotifier/issues/comments/72820675","html_url":"https://github.com/mkiol/GNotifier/issues/42#issuecomment-72820675","issue_url":"https://api.github.com/repos/mkiol/GNotifier/issues/42","id":72820675,"user":{"login":"Noitidart","id":6372489,"avatar_url":"https://avatars.githubusercontent.com/u/6372489?v=3","gravatar_id":"","url":"https://api.github.com/users/Noitidart","html_url":"https://github.com/Noitidart","followers_url":"https://api.github.com/users/Noitidart/followers","following_url":"https://api.github.com/users/Noitidart/following{/other_user}","gists_url":"https://api.github.com/users/Noitidart/gists{/gist_id}","starred_url":"https://api.github.com/users/Noitidart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Noitidart/subscriptions","organizations_url":"https://api.github.com/users/Noitidart/orgs","repos_url":"https://api.github.com/users/Noitidart/repos","events_url":"https://api.github.com/users/Noitidart/events{/privacy}","received_events_url":"https://api.github.com/users/Noitidart/received_events","type":"User","site_admin":false},"created_at":"2015-02-04T09:33:41Z","updated_at":"2015-02-04T09:33:41Z","body":"This one should still be fixed :P Like it should use `B@:@` :)"}}