I have added a 3rd party library as a subproject following the steps under “Usage” section of the following link
http://cocoanetics.github.com/DTCoreText/
However, after adding the subproject, my project builds properly, but i am not able to call any methods which are defined in the subproject, and i am getting following errors :
[NSConcreteAttributedString initWithHTMLData:documentAttributes:]: unrecognized selector
sent to instance 0x71141e0
2012-10-01 17:34:30.600 final_try[7785:11303] *** Terminating app due to uncaught
exception NSInvalidArgumentException', reason: '-[NSConcreteAttributedString
initWithHTMLData:documentAttributes:]: unrecognized selector sent to instance 0x71141e0
*** First throw call stack:
(0x1971012 0x1796e7e 0x19fc4bd 0x1960bbc 0x196094e 0x22a4 0x1f1e 0x6db7b7 0x6dbda7
0x6dcfab 0x6ee315 0x6ef24b 0x6e0cf8 0x1deedf9 0x1deead0 0x18e6bf5 0x18e6962 0x1917bb6
0x1916f44 0x1916e1b 0x6dc7da 0x6de65c 0x1c9d 0x1bc5 0x1)
libc++abi.dylib: terminate called throwing an exception
The implementation file has the following code :
NSString *fileName = [[NSBundle mainBundle] pathForResource:@"mailBody1" ofType:@"txt"];
NSString *str1 = [NSString stringWithContentsOfFile:fileName encoding:NSUTF8StringEncoding error:nil];
str1 = [str1 gtm_stringByUnescapingFromHTML];
NSData *data = [str1 dataUsingEncoding:NSUTF8StringEncoding];
_html = str1;
NSAttributedString *string = [[NSAttributedString alloc] initWithHTMLData:data documentAttributes:NULL];
NSLog(@"%@",[string plainTextString]);
NSLog(@"%@",string);
return self;
Fixed it !! I just needed to add “libDTCoreText.a” static library under the “Link Binary With Libraries” section under my application target