Created attachment 16197 [details]
[PlainString] usage sample
When you are binding an Objective-C class method with `const char *` as parameter, you need to add [PlainString] attribute to C# parameter so, when you pass a string, it passes, literally, a string and not the reference of a NSString.
// @interface CStringTest : NSObject
[BaseType (typeof (NSObject), Name = "CStringTest")]
// - (void)CStringMethodWithMessage:(const char *)message;
void CStringMethod ([PlainString] string message);
But when you have a protocol method with `const char *` as parameter and you add [PlainString] attribute to C# parameter, it compiles but it crashes at runtime:
// @protocol CStringDelegate <NSObject>
[BaseType (typeof (NSObject))]
// @required - (void)CStringRequiredMethodWithMessage:(const char*)message;
void CStringAbstractMethod ([PlainString] string message);
Does this is a bug?
I attached a sample that has the Xcode project, Binding project and a sample that reproduce the bug.
> Does this is a bug?
Yes, you found a missing feature, thanks for the report! I can reproduce it with the test case you provided.