[[NSBundle mainBundle] pathForResource:
returns type NSString
, see NSBundle Class Reference, so you cannot directly assign NSData with NSString
, so you can pass the returned URL to NSData with a different initialiser.
And NSAttributedString
does not have an init method called initWithRTF
. These are why you are seeing the errors.