Re: How to change the product name with command line builds?
Re: How to change the product name with command line builds?
- Subject: Re: How to change the product name with command line builds?
- From: Uli Kusterer <email@hidden>
- Date: Tue, 18 Jan 2011 05:47:30 +0100
On 14.01.2011, at 14:55, Gabriel Zachmann wrote:
> A little bit of background information might be in order.
> I am writing a screensaver.
> Now some users would like to run two different instances (i.e., executables) of it concurrently, because they've got two monitors, and, in addition, they want to set different preferences for each instance.
>
> So, my idea was to just compile the program twice, once under the name Foo and once under the name Foo2.
The Screen Saver Engine will create two instances of your NSView, one for each screen (except when clicking "Test" in System Preferences). Why not just change your code to allow specifying different settings for each screen?
You can find out what screens are available by enumerating over the NSScreens and, when loading a preference, appending the screen's number to each preference key. Or even just to the domain and explicitly specifying the domain whenever you load a preference. When a view is created, you can ask its window for its screen in -viewWillMoveToWindow: and load your preferences appropriately.
I think in the long run, this will not only be the faster approach, it will also be much more elegant. You can provide a decent UI to your users (maybe with a popup menu to select what screen to configure for).
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.lookandfeelcast.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden