Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Mobile Development > BOOK: Beginning iOS 4 Application Development
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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?
Reply With Quote
  #2 (permalink)  
Old June 3rd, 2011, 08:12 AM
Friend of Wrox
Points: 1,671, Level: 16
Points: 1,671, Level: 16 Points: 1,671, Level: 16 Points: 1,671, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Reply With Quote
  #3 (permalink)  
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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:44 PM.


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