I am trying to post a UserNotification from pure C++. I am basing my code off of this SO answer: https://stackoverflow.com/a/14083212/5548305
Right now I am having trouble setting a value for object properties. I am sure there is something I am missing. I was trying to leverage setValue:forKey
but I can't find any documentation on it. I have searched through objc-runtime.h and obj.h but could not find anything that jumped out at me. Has anyone tried/succeeded at this?
#include <CoreFoundation/CoreFoundation.h>
#include <objc/objc.h>
#include <objc/objc-runtime.h>
#include <iostream>
int main(int argc, char** argv)
{
id app = NULL;
id notif = (id)objc_getClass("NSUserNotification");
notif = objc_msgSend(notif, sel_registerName("alloc"));
notif = objc_msgSend(notif, sel_registerName("init"));
notif = sel_setValue(CFSTR("title"), id("title")); <-This line here
objc_msgSend(pool, sel_registerName("release"));
return 0;
}