|
From: | David Chisnall |
Subject: | Re: About internationalization, again |
Date: | Fri, 6 Feb 2009 00:34:32 +0000 |
On 5 Feb 2009, at 23:45, Germán Arias wrote:
El jue, 05-02-2009 a las 19:31 +0000, David Chisnall escribió:None of this is required. If you put your resources in English.lproj/ Spanish.lproj/ (Espanol.lproj/ ?) and so on, and set them as localisedresources in the GNUmakefile then the correct one will be picked from the user's preferences.After try again with the Enlglish.lproj, Spanish.lproj, etc directories,I found the problem. Now all work, thanks.[NSApp release] ; [pool realese] ;I write this because in Dev Center information about NSApplication, there is an example with this lines.return NSApplicationMain (argc, argv);This line is entirely wrong. When the app exits, it will then enter NSApplicationMain, which creates NSApp and runs the app... DavidWell, I don't delete this line, because Project Center add this.
Don't just copy code without understanding it.NSApplicationMain() creates NSApp and tells it to run. If you are doing this yourself, you should not call NSApplicationMain(). If you are calling NSApplicationMain(), you should not create NSApp yourself.
The reason Project Center (which I would advise against using in general) adds this is this is that it is creating a skeleton main() function which only calls NSApplicationMain(), and does nothing else. You can insert lines before the return that do other setup, but you should not duplicate the functionality of NSApplicationMain() and then call it.
David
[Prev in Thread] | Current Thread | [Next in Thread] |