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 July 10th, 2011, 01:11 PM
Authorized User
 
Join Date: May 2011
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 9 -- Application Preferences

Does anyone have any experience with attempting to implement the Chapter 9 "try it out" with Xcode 4? Create settings bundle, start app, no application settings visible. Go to next section, tweak Root.plist as per the text, no application settings visible. Downloaded Chapter 9 from Wrox of course works just fine, but that is inhaled from Xcode 3.
 
Old July 11th, 2011, 12:16 AM
Registered User
 
Join Date: Jul 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have Xcode 4 and all the current versions of everything. I was planning to do this soon and when i saw your question i started to worry. I had downloaded the sdk 4.3 version of the sample code earlier.

I followed the instructions and it worked as indicated.

Last edited by hangzhouharry; July 11th, 2011 at 07:07 PM.. Reason: did more research. corrected speculation in response.
 
Old July 11th, 2011, 08:13 AM
Friend of Wrox
 
Join Date: Aug 2010
Posts: 298
Thanks: 1
Thanked 62 Times in 60 Posts
Default

There should be no issues with adding a settings bundle to an app in Xcode 4.

1. Create the project
2. Add file - Select iOS>Resource>Settings Bundle from the template. Name the file, typically "Settings" and Save.
3. Run the program, click the Settings app and the default settings are there. That is it.

All the stuff about icons is irrelevant, the default blank white one is used if no icon has been provided.

The author's handling of the synchronization of the local and the NSUserDefaults synchronization is weak, since it is hard coded (should parse the Settings.bundle>Root.plist to acquire the keys and default settings, then synchronize) but works for the example.
In an earlier book with the same project, the author's handling of the "loadSettings" method was not correct, but it appears from the downloaded code, that this issue has been addressed. (I don't have the book)

If your problem persists, send the non-working project to
[email protected]

I will try to figure out where things went wrong.



Bob
 
Old July 12th, 2011, 01:29 PM
Registered User
 
Join Date: Jul 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default where the loadSettings is called

I tried the code too, but failed towork even though I typed exactly same as
the book instructed. I just wondering where the loadSetting function call occur,
can anyone help me on this? Also after enter something in the edit box, the the virtual keyboad doesn;t disappear even though enter return.

Thanks
 
Old July 12th, 2011, 01:58 PM
Friend of Wrox
 
Join Date: Aug 2010
Posts: 298
Thanks: 1
Thanked 62 Times in 60 Posts
Default

I assume you have set up the interface. The -loadSettings method is called when you click the loadSettings button in the interface.

Is the keyboard not disappearing in the application or in the Settings application?

If in the application itself, do the following.
In the .xib file make the File's Owner the delegate of the UITextFields. In the ApplicationSettingsViewController.h add the UITextFieldDelegate protocol
Code:
@interface ApplicationSettingsViewController : UIViewController <UIPickerViewDelegate, UIPickerViewDataSource, UITextFieldDelegate>
and in the ApplicationSettingsViewController.m add the following lines

Code:
-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    return YES;
}

Bob
 
Old July 12th, 2011, 02:38 PM
Registered User
 
Join Date: Jul 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks lot. Even I copied your code into it, still doesn;t work. Not sure why.
 
Old July 12th, 2011, 02:44 PM
Friend of Wrox
 
Join Date: Aug 2010
Posts: 298
Thanks: 1
Thanked 62 Times in 60 Posts
Default

If you can't resolve your problem I can take a look at it if you send it to

[email protected]

I am heading out and will be unable to look at it until later tonight, but should be able to resolve any issues.

Bob





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 6, Earthquake 2 [preferences not working] nyyrikki BOOK: Professional Android 2 Application Development 8 January 7th, 2013 10:59 AM
Chap6 - Earthquake not updating when nothing matches preferences cartoon BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 1 January 16th, 2010 05:41 AM
VBScript and printer preferences CmdrDuh VB How-To 0 November 9th, 2007 03:07 PM
Application Preferences And Resource Files geomar General .NET 0 November 14th, 2006 01:35 PM
XML, Sessions and Application Preferences pipelineconsulting Classic ASP XML 0 September 16th, 2005 04:41 AM





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