Questions Columns Rows
GitHub icon

Objective-C

Objective-C - Programming language

< >

Objective-C is a programming language created in 1984 by Brad Cox.

#44on PLDB 39Years Old 536kRepos

Try now: Riju

Objective-C is a general-purpose, object-oriented programming language that adds Smalltalk-style messaging to the C programming language. It was the main programming language used by Apple for the OS X and iOS operating systems, and their respective application programming interfaces (APIs) Cocoa and Cocoa Touch prior to the introduction of Swift. The programming language Objective-C was originally developed in the early 1980s. Read more on Wikipedia...


Example from Riju:
#import <Foundation/Foundation.h> int main() { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSLog(@"Hello, world!"); [pool drain]; return 0; }
Example from hello-world:
/* Build on OS X: clang -framework Foundation -fobjc-arc objc.m -o objc Build on Linux with GNUstep: clang `gnustep-config --objc-flags` `gnustep-config --base-libs` -fobjc-nonfragile-abi -fobjc-arc objc.m -o objc */ #import <Foundation/Foundation.h> int main(void) { NSLog(@"Hello World"); }
/* Hello World in Objective-C. ** Since the standard implementation is identical to K&R C, ** a version that says hello to a set of people passed on ** the command line is shown here. */ #include <stdio.h> #include <objpak.h> int main(int argc,char **argv) { id set = [Set new]; argv++;while (--argc) [set add:[String str:*argv++]]; [set do:{ :each | printf("hello, %s!\n",[each str]); }]; return 0; }
Example from Linguist:
#import "Foo.h" @implementation Foo @end
Example from Wikipedia:
-(void) firstLabel: (int)param1 secondLabel: (int)param2;
Objective-C Keywords
auto break case char const continue default do double else enum extern float for goto if inline int long register restrict return short signed sizeof static struct switch typedef union unsigned void volatile while _Bool _Complex _Imaginary BOOL Class bycopy byref id IMP in inout nil NO NULL oneway out Protocol SEL self Super YES @ @interface @end @implementation @protocol @class @public @protected @private @property @try @throw @catch() @finally @synthesize @dynamic @selector atomic nonatomic retain

View source

- Build the next great programming language Search Add Language Features Creators Resources About Blog Acknowledgements Stats Sponsor Traffic Traffic Today Day 267 feedback@pldb.com Logout