Tips to deploy applications to multiple Mac OS X versions

2008-04-09 Thread Lorenzo Bevilacqua

Hi,

I'm trying to build a Cocoa application so that it can run on Mac OS X  
from version 10.3.9 to 10.5.
I have 10.5 installed so the application runs fine on my system and on  
other Leopard systems.
I haven't build a project for multiple platforms yet, so I tried to  
duplicate the main Xcode target and set different deployment target  
settings like


myApp for Leopard   MACOSX_DEPLOYMENT_TARGET set to 10.5
myApp for Tiger MACOSX_DEPLOYMENT_TARGET set to 10.4
myApp for Panther   MACOSX_DEPLOYMENT_TARGET set to 10.3

The SDK I use is the Leopard one.

Till now all Ok, but when I try to compile for example the Tiger  
target I get some errors (mainly about fast enumeration). Thus I have  
some questions:


- It is correct to proceed like I described above?
- Does the Objective-C 2.0 fast enumeration make sense to be used? I  
mean, if I don't use it, will my application perform worse on Leopard?
- Is there a way to differentiate part of code by platform? I remember  
I saw in some files lines like this


#if MACOSX_DEPLOYMENT_TARGET == MAC_OS_X_VERSION_10_4
#endif

is this correct?


Thanks,

Lorenzo Bevilacqua
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Sheet window as firstResponder

2008-04-25 Thread Lorenzo Bevilacqua

Hi,

I'm trying to get keyDown events from the contentView of a sheet window.
I overrided the acceptsFirstResponder method to return YES, and added  
a - (void) keyDown: (NSEvent *) event.


The problem is that when the sheet becomes visible and I press a key I  
hear a system alert and the keyDown isn't called.
I checked what's the nextResponder for that view (the window) and  
added keyDown method also for it, but same thing, beep and no keyDown.


I think that this problem is related to the fact that the window is  
modal.
I found something about modal windows looking in the documentation,  
but the informations aren't clear.


"NSWindow objects are passive participants in the modal-window  
mechanism; it's the application that programmatically initiates and  
manages modal behavior. To run a window modally, NSApp uses its normal  
event loop machinery but restricts input to a specific window or  
panel. In the loop, it fetches events but if the events do not meet  
certain criteria—most importantly their association with the modal  
window—it tosses them." (from Cocoa Fundamentals Guide - The Core  
Application Architecture - Windows - Modal windows)


How should I proceed?

Thanks,

Lorenzo Bevilacqua___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]