MoinMoin Logo
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Navigation

  • Start
  • Sitemap

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment

Revision 2 as of 2016-11-10 01:08:38
  • ObjectiveC

ObjectiveC

  • http://www.maheshsubramaniya.com/article/hello-world-in-objective-c-and-compiling-with-gcc.html

Example with gcc-obj

   1 /*
   2 http://ftpmain.gnustep.org/pub/gnustep/core/gnustep-make-2.6.8.tar.gz
   3 http://ftpmain.gnustep.org/pub/gnustep/core/gnustep-base-1.24.9.tar.gz
   4 http://ftpmain.gnustep.org/pub/gnustep/core/gnustep-gui-0.25.0.tar.gz
   5 http://ftpmain.gnustep.org/pub/gnustep/core/gnustep-back-0.25.0.tar.gz
   6 
   7 gcc -lgnustep-base -lobjc main.m -o main -L /usr/GNUstep/Local/Library/Libraries -I /usr/GNUstep/System/Library/Headers/ -fconstant-string-class=NSConstantString
   8 */
   9 
  10 #import <Foundation/Foundation.h>
  11 #import <stdlib.h>
  12 #import <stdio.h>
  13 
  14 @interface Hello:NSObject
  15     - (void)greet:(char *)msg msg2:(NSString *)msg2;
  16 @end
  17 
  18 @implementation Hello
  19     - (void)greet:(char *)msg msg2:(NSString *)msg2 {
  20         printf("Hello, World! %s %s \n", msg, [msg2 cString] );
  21         NSLog(@"Hello, World! %s %@", msg , msg2 );
  22     }
  23 @end
  24 
  25 int main(void) {
  26     NSString *str1 = @"ijk";
  27     id myhello = [ [Hello alloc] init];
  28     [ myhello greet:"GNUStep ..." msg2:str1 ];
  29     [ myhello release ];
  30     return EXIT_SUCCESS;
  31 }
  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01