1. Home
  2. /
  3. Objective-c
  4. /
  5. Name Greeting

Name Greeting - Objective-c Typing CST Test

Loading…

Name Greeting — Objective-c Code

Greets users by name.

#import <Foundation/Foundation.h>

void greet(NSString *name){
	NSLog(@"Hello, %@! Welcome!", name);
}

int main(int argc, const char * argv[]) {
	@autoreleasepool {
		greet(@"Saurav");
		greet(@"Alice");
		greet(@"Bob");
	}
	return 0;
}

Objective-c Language Guide

Objective-C is a general-purpose, object-oriented programming language that adds Smalltalk-style messaging to C. It has been the primary language for macOS and iOS development before Swift, enabling developers to create applications for Apple platforms with dynamic runtime capabilities.

Primary Use Cases

  • ▸macOS and iOS application development
  • ▸Legacy Apple framework integration
  • ▸Developing Cocoa and Cocoa Touch applications
  • ▸Creating reusable Objective-C libraries
  • ▸High-performance system-level Apple apps

Notable Features

  • ▸Object-oriented with classes and categories
  • ▸Dynamic runtime with message passing
  • ▸Automatic Reference Counting (ARC) for memory management
  • ▸Protocol-based polymorphism
  • ▸Interoperable with C and C++ code

Origin & Creator

Developed in the early 1980s by Brad Cox and Tom Love, combining C with Smalltalk-style object-oriented messaging.

Industrial Note

Objective-C remains critical for maintaining legacy macOS and iOS applications and for interfacing with older Apple frameworks that are not fully migrated to Swift.

More Objective-c Typing Exercises

Objective-C Counter and Theme ToggleObjective-C Random Number GeneratorObjective-C Todo ListObjective-C Dice RollerObjective-C Countdown TimerObjective-C Prime CheckerObjective-C Temperature ConverterObjective-C Shopping CartObjective-C Stopwatch

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher