Wrox Programmer Forums
|
BOOK: Beginning iOS Programming: Building and Deploying iOS Applications
This is the forum to discuss the Wrox book Beginning iOS Programming: Building and Deploying iOS Applications by Nick Harris; ISBN: 978-1-118-84147-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning iOS Programming: Building and Deploying iOS Applications 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 September 22nd, 2014, 05:13 AM
Registered User
 
Join Date: Sep 2014
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Keyboard doesn't disappear

I've been working through the tutorial but at Chapter 4 ("Adding a UITextField") page 82-3, I've ground to a halt. When I test the app, I can enter into the textfield but clicking RETURN does nothing. I did a trace and it does complete textFieldShouldReturn. I've gone over my code and it seems to be as stipulated (including errata) so I can't see the problem.
 
Old September 23rd, 2014, 05:10 AM
Registered User
 
Join Date: Sep 2014
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Keyboard doesn't disappear

OK, while awaiting a response, I decided to repeat the exercise from the start and this time it was different - now the keyboard doesn't appear when I click on the UITextField!

Also, I'm a little confused by the instructions on page 81 "Adding a UITextField"(remember I'm VERY new to Xcode!) - is point 5 an expansion of point 4 or an additional instruction? I took it as the former but I just wanted to check.

Hello, hello...anyone out there?
 
Old October 13th, 2014, 12:52 AM
Registered User
 
Join Date: Oct 2014
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chpt - 4 A Fix to Keyboard Won't disappear pgs 82-83

A more efficient way to set the Delegate for the UITextField and let the delegate act on behalf of the UITextField and dismiss the keyboard when the Return key is pressed...

To set the delegate, open the Main.storyboard and select the UITextField at the top, press the Control key and drag a line using the left mouse button to the View Controller (Yellow Orb) at bottom of screen. Release mouse button and Popover appears. Select the Delegate in the Outlets section.

Note: Make sure textFieldShouldReturn: method is included and the corrections are made from the Errata page on Wrox.com/go/begiosprogramming for chpt 4 in steps 9 and 10.

Next, with the UITextField selected, go to the Attribute Inspector and for the Return Key property, select Done. Then run the application.

This should work.
 
Old October 14th, 2014, 11:19 PM
Registered User
 
Join Date: Sep 2014
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OrangeLady, thank you and that feature is now working.
 
Old October 15th, 2014, 12:32 AM
Registered User
 
Join Date: Sep 2014
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

So, I went on and added the Save button (p85) and at step 9, I run the app but when I click on the grey text view field, the save button doesn't appear. I've gone back and checked my code several times and it all seems as per the instructions - frustrating!

I even added an NSLog trace to textViewShouldBeginEditing method after "self.saveNotesButton.enabled = YES;" and that shows in the console, so the code is being executed.

I'm still puzzled as to how the button I added and labelled as "Save" became equated with the saveNotesButton identifier.
 
Old October 15th, 2014, 10:22 PM
Registered User
 
Join Date: Oct 2014
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Page 85 - Save Button Won't Display

Try on page 86 after Step 8, Select the Save button. Go to the Attributes Inspector.

Ctrl Drag left mouse button from "Touch Up Inside" under Sent Event to the Save Button. I also change the text color and Shadow Color in Attribute Inspector to Light Grey. With the Save button selected check the Connection Inspector and you will see two connections, an IB Outlet and IB Action.

This will make the Save button work.

Thanks
 
Old October 16th, 2014, 01:29 AM
Registered User
 
Join Date: Sep 2014
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OrangeLady, perhaps we are on different versions of xcode (I'm on 6.0.1). I say that because the attributes inspector doesn't seem to show sent events. They are under the connections inspector and it shows the sent event "touch up inside" as view controller saveNotesButtonTouched and "referencing outlet" as saveNotesButton view controller. I don't know which inspector shows IB Outlet and IB Action. Right-clicking on the Save button also shows the connections inspector info.
 
Old October 16th, 2014, 09:28 AM
Registered User
 
Join Date: Oct 2014
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Page 85 - Save Button Won't Display

New2xcode, Yes to follow along in the book you need to be on Xcode 5. I was experiencing the same problems you had.

So I went to www.developer.apple.com to download the previous version of Xcode 5.1/SDK 7.1 (note: this version supports iPhone 4 whereas Xcode 6 support iPhone 4s and not iPhone 4) and saved to a different folder name e.g. Xcode 5.1.

So now I have both versions of Xcode on my system. Then start these exercises over again with Xcode 5 and it will work.

Thanks.
 
Old October 16th, 2014, 07:25 PM
Registered User
 
Join Date: Sep 2014
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OrangeLady: that makes sense and I'll organise it as soon
as I return to civilisation and a reliable internet connection.
Many thanks!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Ex1_02 execute and disappear soon Alex S BOOK: Ivor Horton's Beginning Visual C++ 2012 0 May 11th, 2013 07:34 AM
Links that disappear Surre ASP.NET 1.0 and 1.1 Professional 8 February 2nd, 2007 11:15 AM
Radio buttons disappear JoeBob49 ASP.NET 2.0 Basics 2 November 27th, 2006 09:57 AM
Strange graphic appear-disappear karib HTML Code Clinic 5 June 14th, 2006 02:43 PM
Menu disappear! Tachyophan Excel VBA 0 December 19th, 2003 03:02 PM





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