In this tutorial, I explain how to open a text file in a text view or label. This can be used to store usernames, passwords, and more. You can even make an eBook easier than ever!
Check out WiiDG!
http://youtube.com/WiiDG
----------------------------------------------------------------------
For shout-outs, blog advertising and more, check out the "Advertise" page on my blog.
http://blog.simplesdk.com/index.php/advertise/
----------------------------------------------------------------------
Other Links:
http://twitter.com/SimpleSDK
http://blog.simplesdk.com
(continued from below) Then in the implementation file, synthesize the label. in the ViewController.xib, drag a label on the view, right click it, and drag the New referencing outlet to File's owner and click [your label name]. hope this helps!
thesciencekid8 1 week ago
Note to Xcode4 users:
there is already a view did load method in the file. you just need to add this to it: NSString *filePath = [[NSBundle mainBundle] pathForResource:@"file" ofType:@"txt"]; [super viewDidLoad]; if (filePath) { NSString *textFromFile = [NSString stringWithContentsOfFile:filePath]; label.text = textFromFile;
in the header file, add a UILabel. then add the following:
@property (nonatomic, retain) IBOutlet UILabel *label;
thesciencekid8 1 week ago
@araz01000 i was being sarcastic right now i got money on my MONEY so screw your sht of tutorial which dates back to 1999
araz01000 1 month ago
Thanks for your help
araz01000 1 month ago
but i don't know what to add it as a PDF, txt, html ??
araz01000 1 month ago
i'm trying to make a dictionary i need to add the 600paged pdf file :I
araz01000 1 month ago
This is a great video. I am very impressed at your knowledge of iPhone development and especially the simplicity with which you present your tutorials. I learn better from you than I have from "college" courses.
I was wondering about this tutorial if there is a way to randomize text messages so that a different message can be displayed each time the app is launched or perhaps once a day.
I'm thinking of maybe an html feed with timed messages. What do you think is best?
LTPWebSeo 2 months ago
@joy1819 one of the letters in that: ContentsofFile should be Upper case --> OfFile rather than ofFile. i did the same lols
mxjoe7 6 months ago
I get a warning saying that 'NSString' may not respond to '+stringWithContentsofFile:' (messages without a matching method signature will be assumed to return 'id' and accept '...' as arguments). Also, the text file is not displayed. I have exactly the same code as you. Ideas?
joy1819 7 months ago
Thumbs up! ...It's not often that I need help, but I was stuck on this topic for a long time. Does anyone know how I would get the contents of a text file somewhere else on my hard drive? Thanks.
HintProductionz 8 months ago