Talk:Hello world/Graphical: Difference between revisions

Content added Content deleted
(→‎Objective-C: works with|Cocoa?)
(obj-c)
Line 34: Line 34:


: I'm guessing that most of the Objective-C samples were written by a [[Mac OS X]]/[[Cocoa]] developer, since they are the prime users of Objective-C. Perhaps you could prefix the non-working-with-GNUStep examples with the {works with|Cocoa} template? --[[User:IanOsgood|IanOsgood]] 17:45, 9 December 2008 (UTC)
: I'm guessing that most of the Objective-C samples were written by a [[Mac OS X]]/[[Cocoa]] developer, since they are the prime users of Objective-C. Perhaps you could prefix the non-working-with-GNUStep examples with the {works with|Cocoa} template? --[[User:IanOsgood|IanOsgood]] 17:45, 9 December 2008 (UTC)

::Don't know really... I've also a Cocoa/Cocoa.h header, which is just an inclusion of Foundation/Foundation.h and AppKit/AppKit.h, with some more thing... the header stating "Cocoa compatible declarations". So hopely I should be able to do my Cocoa programming under GNU/Linux :D ... The fact is that this example uses just basic language things, and NSAlert, which exist in GNUstep framework, and I believed that such a code should compile and run on my platform. I succeeded compiling, ... if I change the code this way:

<pre>#import <AppKit/AppKit.h>

int main()
{
NSAlert *alert = [[NSAlert alloc] init];
[alert setMessageText: @"Goodbye, World!"];
[alert runModal];
[alert release];
}</pre>

::the "autorelease called without pool" error is not risen... but a great ''segmentation fault'' is the only thing I obtain anyway :(. I need to take a deeper tour on Obj-C on the web; I want it working :) --[[User:ShinTakezou|ShinTakezou]] 18:59, 9 December 2008 (UTC)