Too many Arguments To Function Call Using Xcode 13 MacOS 12.0SDK

Getting the following error when trying to build code with MacOS 12.0 SDK. Any idea why I'm getting this error.

id Key; //Assume key has some data
IMP pEncoder;
pEncoder = [NSCoder_Pointer_Obj methodForSelector: @selector(encodeObject)];

(*pEncoder)(NSCoder_Pointer_Obj, @selector(encodeObject: ), key); 
//Getting error in the above line
//Error: "Too many arguments to function call, expected 0, have 3

This code used to compile well with MacOS 10.14 SDK but compiling with 11 or 12 SDK

EDIT: The above piece of code not compiling with MacOS 11.0 and 12.0 SDK

Too many Arguments To Function Call Using Xcode 13 MacOS 12.0SDK
 
 
Q