Talk:Hello world/Graphical: Difference between revisions

→‎Objective-C: obj-c code is really incomplete
(obj-c)
(→‎Objective-C: obj-c code is really incomplete)
Line 48:
 
::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)
 
:Continuing learning how to develop GNUstep or Cocoa apps (under GNU/Linux), ... now I am (almost) ''sure'' that ''Objective-C example lacks basic stuffs'' to work! Looking [http://wiki.gnustep.org/index.php/Cocoa here] I know that I can compile and see NSAlert... but the provided code is missing initialization and is usable just by people already knowing how to put altogether full working app with Cocoa/GNUstep in Obj-C. After experimenting, I produced:
 
<pre>#import <Cocoa/Cocoa.h>
 
int main( int argc, const char *argv[] )
{
NSApplication *app;
NSAutoreleasePool *pool;
pool = [NSAutoreleasePool new];
app = [NSApplication sharedApplication];
//NSApplicationMain(argc, argv);
NSAlert *alert = [[NSAlert new] autorelease];
[alert setMessageText: @"Goodbye, World!"];
[alert runModal];
}</pre>
 
:that still is not working but resolved the ''autorelease called without pool for object'' problem allocating the lacking pool... At least... a step beyond... I will continue and when I will find it, I will fix the code... (promise I won't write more here, but I would like the person who put the code to complete it...) --[[User:ShinTakezou|ShinTakezou]] 21:26, 9 December 2008 (UTC)