[quote=danielb21;102822]Hey afb, that tutorial has actually been up for quite a while. You'll find it here:
PDF Creation Tutorial
Thanks for making the tutorial...such a HUGE help.
I had a question
in your tutorial I create a global NSString *nameText in PDFViewController.m
and in viewDidLoad method set it to
nameText = [NSString stringWithFormat:@"%@", nameField.text];
then use
CGContextSelectFont (pdfContext, "Helvetica", 24, kCGEncodingMacRoman);
CGContextSetTextDrawingMode (pdfContext, kCGTextFill);
CGContextSetRGBFillColor (pdfContext, 0, 0, 0, 1);
const char *text2 = [nameText UTF8String];
CGContextShowTextAtPoint (pdfContext, 50, 375, text2, strlen(text2));
in void CreatePDFFile (CGRect pageRect, const char *filename)
when I run the app in the simulator and press the button app crashes and Xcode gives a obj_msgSend error.
Im trying to get it so the user can input a string in a textfield and have it displayed in the pdf but the error always occurs unless, I declare the nameText string in the void CreatePDFFile but then reads an error of nameField.text (undeclared first use in this function) when it was defined globally and working in other parts of the view and will not build.
any help or ideas would greatly be appreciated.