Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Draw This
($0.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 08-03-2009, 12:17 AM   #14 (permalink)
palian3
Registered Member
 
Join Date: Feb 2009
Posts: 5
palian3 is on a distinguished road
Default Displaying User input in the PDF

[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.
palian3 is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,020
Threads: 93,863
Posts: 401,920
Top Poster: BrianSlick (7,962)
Welcome to our newest member, wendolynlm80
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:11 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.