Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Mac > BOOK: Beginning Mac OS X Programming
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning Mac OS X Programming
This is the forum to discuss the Wrox book Beginning Mac OS X Programming by Michael Trent, Drew McCormack; ISBN: 9780764573996
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Mac OS X Programming 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 Display Modes
  #1 (permalink)  
Old July 11th, 2010, 05:58 PM
Registered User
 
Join Date: Jul 2010
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chap 4: Resizable Windows in Cocoa

I am having a problem with the example showing how to make a resizable window using Cocoa.

I don't have any problem when the window is small. I set a minimum size and all the objects stay placed as they should. However when I make the window large vertically by pulling down on the resizing control the two buttons, the small text field box and the top edge of the large multi-line text view box all migrate upwards past the menu bar. The bottom edge of the large text view box does not move down as the window's bottom edge is pulled down. Everything is fine horizontally.

I am using the 2005 "Tiger" version of the text with Xcode/Interface Builder 3.2.3 (since I have Snow Leopard installed) and so there are some differences on how some things are done in the version of Xcode/IB used by the authors and version I am running. Instead of spring symbols IB 3.2.3 uses struts and arrows. However I downloaded the author's code and it behaves perfectly as intended in IB 3.2.3 and so I compared the "strut and arrow" settings for all the objects they had vs. mine and even though they are all the same, their code works fine while mine does not. I even have tried comparing what the newer version of the book has to my settings and I can't see a difference.

I assume there is another parameter that needs to be changed that I am unaware of. I tried comparing the author's file to mine using File Merge but there are really too many (80) to sort through given my level of understanding.

Does anybody have an idea of what the problem could be?

Thanks
Reply With Quote
  #2 (permalink)  
Old July 12th, 2010, 02:56 PM
Registered User
 
Join Date: Apr 2010
Location: West Wellow, England
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Mike,

I've worked through the IB chapter in the Snow Leopard version of the book and all the code works fine with 3.2. Wouldn't it be easier for you to just get the latest book and save yourself all of the added complexity of learning from a book that's not compatible with the s/w platform you're on?
Reply With Quote
  #3 (permalink)  
Old July 13th, 2010, 12:48 AM
Registered User
 
Join Date: Jul 2010
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for taking the time to offer advice.

I actually have cross-referenced the newer Snow Leopard version of the book to see if following the instructions there would resolve the problems, However it didn't really help. I also downloaded the publisher's example code and that runs great on 3.2.3. Assuming the code available on the 2005 edition's website is the original (and not updated) there seems to be no compatibility problem.

So I was attempting to find the differences between the two codes by seeing what attributes in Inspector differed between the two. I couldn't find any and tried comparing them in File Merge which shows a lot of differences but I do not yet know how to read the markup language used in the .nib file and the number of differences is too large to sort through without being able to approach it intelligently. I would really like to find some other debugging tool or method that would provide more info than the Inspector but less condensed and more user friendly than the File Merge.

I think there must be some problem with my installation since the downloaded code runs fine. Hopefully I will get some good debugging experience.
Reply With Quote
  #4 (permalink)  
Old July 22nd, 2010, 10:44 PM
Registered User
 
Join Date: Jul 2010
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Solution

For anyone interested in the solution to this problem.

Using the authors' example .nib file as a starting point. In the window representing the nib file there is an object of type NSWindow representing the interface's main Window. Clicking on the triangle to the left to expand the contents of the Window object shows an object called Content View of type NSView. Clicking on the triangle to the left to expand the contents of the Content View shows the four objects added to the interface during the exercise: two Push Button objects of type NSButton, a text field of type NSTextField and a Bordered Scroll View of type NSScrollView. Clicking on each of these four objects and examining their attributes in the Size Inspector shows the "strut" and "spring (arrow)" settings of the Autosizing Mask. These settings are the same as depicted in steps 13 to 21 of pages 110 and 111 of the 2010 "Snow Leopard" version of the text.

But there is an additional mask autosizing control that appears in the Size Inspector of the Content View object. In the authors' example file, all four "struts" are in place and none of the "springs (arrows)" are selected. However if the bottom strut of this autosizing mask is removed the behavior mentioned in my original post occurs. Specifically, when pulling down on the resizing control, the two buttons, the small text field box and the top edge of the large multi-line text view box all migrate upwards past the menu bar while the bottom edge of the large text view box does not move down as the window's bottom edge is pulled down.

Last edited by mikem; July 22nd, 2010 at 10:50 PM.
Reply With Quote
Reply


Thread Tools
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
Chap 2 - Avatars and uploading files, (would apply to Chap 6 too) kenj BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9 0 October 18th, 2009 03:14 PM
SHDocVw.ShellWindows not working In Windows Server 2008 For the IE Windows. snkt_shah Beginning VB 6 1 October 15th, 2009 04:43 PM
issue with windows specch SDK 5.1 on windows 2003 server. msathyaprasad90 ASP.NET 3.5 Basics 0 February 13th, 2009 01:45 AM
How to create Resizable controls AccessAasif@aol.com C# 2005 1 November 10th, 2007 05:13 AM
Windows 98 OCX control issues vs Windows XP benoyraj VB How-To 0 May 5th, 2004 08:10 AM



All times are GMT -4. The time now is 06:11 AM.


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