id topLayoutGuideObj = objc_msgSend(viewController, @selector(myselector));
\"Too many arguments to function call, expected 0, h
See just a few lines above you referred.
/*
* ...
*
* These functions must be cast to an appropriate function pointer type
* before being called.
*/
You can call it like:
#import
#import
id topLayoutGuideObj = ((id (*)(id, SEL))objc_msgSend)(viewController, @selector(myselector));
OR
id (*typed_msgSend)(id, SEL) = (void *)objc_msgSend;
id topLayoutGuideObj = typed_msgSend(viewController, @selector(myselector));