Wrox Programmer Forums
|
BOOK: Beginning iOS 4 Application Development
This is the forum to discuss the Wrox book Beginning iOS 4 Application Development by Wei-Meng Lee; ISBN: 978-0-470-91802-9
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning iOS 4 Application Development section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 2nd, 2011, 03:35 PM
Registered User
 
Join Date: May 2011
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ch. 10 - pg. 274: Copying Bundled Resources

Hi All,

I've done everything in chapter 10 with no problems so far: everything works, AND I actually understand it.

The only problem arises with the last bit of sample-code, called "Copying Bundled Resources".
1) HOW do we check for what its doing? Meaning, how do we know it copied the Resources file and wrote it to the Documents folder?
I'm not seeing any new files there other then the "Apps.plist" and "data.txt" files that were created with the previous pieces of sample-code from this chapter.

2) In the AppDelegate file - WHEN/HOW is this method called?

Code:
-(void) copyFileInBundleToDocumentsFolder: (NSString *) fileName withExtension: (NSString *) ext {
What's calling it? I don't see it getting called by the "didFinishLaunchingWithOptions:" method, so what's calling it?

3) Finally, what values are being plugged-in for the method's arguments "fileName" and "ext"? Where do we see that?
 
Old June 3rd, 2011, 08:12 AM
Friend of Wrox
 
Join Date: Aug 2010
Posts: 298
Thanks: 1
Thanked 62 Times in 60 Posts
Default

Since I don't have the book I can't check the steps page by page, but the download has the call to
-(void)copyFileInBundle…
in
-didFinishLaunchingWithOptions…
On p 275 (using the "look inside" at Amazon) the text has this call added. The method is called. To verify that it is called, you can delete the files in the Application's Documents folder and run the program. The "File copied" log message will be displayed in the console, and rechecking the Application's Documents folder will show that the file is there. If previous exercises already placed a file of the same name in the Documents folder the "if" statement in the -copyFileInBundle method will cause actual copying to be skipped, since it only makes the copy if the file does not already exist at the location.

Based on the call in -didFinishLaunchingWithOptions…
fileName is "Apps" and ext is "plist"

Bob
 
Old June 4th, 2011, 02:56 PM
Registered User
 
Join Date: May 2011
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ok I'll look into this and let you know how I do - thanks as usual.

in the meantime I'm running into issues in Ch. 20 with the rotation/compass bits of code (I'm not getting errors, but it just doesn't work - even when I tried the author's code [meaning the actual files he made available for download from this here web-site] - they didn't produce the right results either...)

I'll make it a separate post though, so future users can reference it as well if necessary.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Error when creating resources (Ch.3) xnajoan BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 2 April 16th, 2010 08:03 AM
Ch 8: <asp:image> inside <a> & ext.CSS (pg. 274) epc BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 July 12th, 2008 04:37 AM
Chapter 10 pg. 339 trouble Tachyon BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 2 March 12th, 2004 03:39 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.