How can I bind this using MonoTouch??
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 60000
@interface NSObject (SubscriptingSupport)
- (id)objectAtIndexedSubscript:(NSUInteger)idx;
- (void)setObject:(id)obj atIndexedSubscript:(NSUInteger)idx;
- (void)setObject:(id)obj forKeyedSubscript:(id <NSCopying>)key;
- (id)objectForKeyedSubscript:(id)key;
@end
#endif
Tried this following Documentation but had no luck
[BaseType (typeof (NSObject)), Bind ("NSObject")]
public interface NSObject2
{
[Bind("objectAtIndexedSubscript:")]
NSObject ObjectAtIndexedSubscript (uint idx);
[Bind("setObject:atIndexedSubscript:")]
void SetObjectAtIndexedSubscript (NSObject obj, uint idx);
[Bind("setObject:forKeyedSubscript:")]
void SetObjectForKeyedSubscript (NSObject obj, NSObject key);
[Bind("objectForKeyedSubscript:")]
NSObject ObjectForKeyedSubscript (NSObject key);
}
it gives tons of errors like
Error CS0115: `DocParser.Dispose(bool)’ is marked as an override but
no suitable method found to override (CS0115)
Thanks in advance
Alex.
The binding tool does not have support for generating stubs for extensions to core classes.
The good news is that fundamentally, the work is very simple: you must send a message to an object of instance NSObject.
This means that you can write the code by hand that does something like:
The above can be cumbersome to write by hand, so you can run the generator on a fictitious class and then copy/paste the results into your own class that takes a parameter “NSObject target” as shown above.