I’m seriously stuck with this.
I’ve used mainly the code from the apple docs and it works fine. Now I am trying to change 1 part and I keep getting errors!!
CFAttributedStringRef currentText = CFAttributedStringCreate(NULL, (CFStringRef)textView.text, NULL);
if (currentText) {
CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString(currentText);
if (framesetter) {
I am trying to replace textView.text with a single string, so that the PDF is built with the data from the string as opposed to the text view, but when I change that code to
CFAttributedStringRef currentText = CFAttributedStringCreate(NULL, (CFStringRef)stringHere, NULL);
it errors me with:
Thread 1: EXC_BAD_ACCESS (code=1, address0x0).
I’ve also tried:
CFStringRef stringRef = (CFStringRef)stringHere;
CFAttributedStringRef currentText = CFAttributedStringCreate(NULL, stringRef, NULL);
But i get the same error. Can anyone help?
stringHere is 0x0 (aka nil aka NULL)