Search code examples
xamarin.iosnstextstorage

Monotouch NSTextStorage implementation how to


I'm trying to port some objective c codes to c# header file contains

@interface MyStorage : NSTextStorage
@end

and implementation is something like

#import "MyStorage .h"
@interface MyStorage ()
@property (nonatomic,strong) NSMutableAttributedString *myAttrString;
- (id)init
{
    if (self = [super init]) {

        _myAttrString= [NSMutableAttributedString new];

    }
    return self;
}
- (NSString *)string
{
    return [_myAttrString string];
}

but i can not understand the

- (NSString *)string
{
    return [_myAttrString string];
}

part. It's a abstract property or something like that i think, but i do not know how to override it on c#, does anybody know what is that?


Solution

  • thnks for your reply Larry, but i found it as i search for overridable methods and properties, it is:

    public override IntPtr LowLevelValue {
                get {
                    return _myAttrString.LowLevelValue;
                }
            }
    

    so if you take some abstraction errors on runtime, just keep on looking overridable methods and properties :)