Created
November 11, 2013 21:09
-
-
Save brendanzagaeski/7420369 to your computer and use it in GitHub Desktop.
Subclassing NSMutableAttributedString causes an error "[CustomNSAttributedString initWithAttributedString:]: unrecognized selector sent to instance 0x4418b0"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using MonoMac.Foundation; | |
using MonoMac.CoreText; | |
using MonoMac.AppKit; | |
namespace SubclassingTest | |
{ | |
public class Program | |
{ | |
static void Main (string[] args) | |
{ | |
NSApplication.Init (); | |
var attrs = new CTStringAttributes () { | |
Font = new CTFont ("HoeflerText-Regular", 24.0f), | |
LigatureFormation = CTLigatureFormation.All, | |
KerningAdjustment = 10, | |
UnderlineStyle = CTUnderlineStyle.Single, | |
StrokeWidth = 5 | |
}; | |
var attributedString = new NSAttributedString ("Hello world", attrs); | |
var customTest = new CustomNSAttributedString (attributedString); | |
Console.WriteLine ("customTest.ClassHandle: {0}", customTest.ClassHandle); | |
} | |
} | |
public class CustomNSAttributedString : NSMutableAttributedString | |
{ | |
public CustomNSAttributedString (NSAttributedString other) : base (other) | |
{ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment