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 July 10th, 2011, 01:11 PM
Authorized User
Points: 92, Level: 1
Points: 92, Level: 1 Points: 92, Level: 1 Points: 92, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
Reply With Quote
  #2 (permalink)  
Old July 11th, 2011, 12:16 AM
Registered User
Points: 6, Level: 1
Points: 6, Level: 1 Points: 6, Level: 1 Points: 6, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
Reply With Quote
  #3 (permalink)  
Old July 11th, 2011, 08:13 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

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
ipadhelper@me.com

I will try to figure out where things went wrong.



Bob
Reply With Quote
  #4 (permalink)  
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
Reply With Quote
  #5 (permalink)  
Old July 12th, 2011, 01:58 PM
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

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
Reply With Quote
  #6 (permalink)  
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.
Reply With Quote
  #7 (permalink)  
Old July 12th, 2011, 02:44 PM
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

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

ipadhelper@me.com

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

Bob
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
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



All times are GMT -4. The time now is 10:27 PM.


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