12/08/2018, 14:42

Learn Objective-C

Objective-C Overview Objective-C is general-purpose language that is developed on top of C Programming language by adding features of Small Talk programming language making it an object-oriented language. It is primarily used in developing iOS and Mac OS X operating systems as well as its ...

  1. Objective-C Overview Objective-C is general-purpose language that is developed on top of C Programming language by adding features of Small Talk programming language making it an object-oriented language. It is primarily used in developing iOS and Mac OS X operating systems as well as its applications.
  2. Objective-C Environment Setup
  • Text Editor
  • The GCC Compiler.
  • Xcode Xcode is currently available at developer.apple.com/technologies/tools/
  1. Objective-C Program Structure A Objective-C program basically consists of the following parts:
  • Preprocessor Commands
  • Interface
  • Implementation
  • Method
  • Variables
  • Statements & Expressions
  • Comments
  1. Objective-C Basic Syntax
  • Tokens in Objective-C ex: NSLog(@"Hello, World! ");
  • Semicolons ;
  • Comments
  • Identifiers An Objective-C identifier is a name used to identify a variable, function, or any other user-defined item. An identifier starts with a letter A to Z or a to z or an underscore _ followed by zero or more letters, underscores, and digits (0 to 9).
  • Keywords
  1. Objective-C Data Types The types in Objective-C can be classified as follows:
  • Basic Types: They are arithmetic types and consist of the two types: (a) integer types and (b) floating-point types.
  • Enumerated types: They are again arithmetic types and they are used to define variables that can only be assigned certain discrete integer values throughout the program.
  • The type void: The type specifier void indicates that no value is available.
  • Derived types: They include (a) Pointer types, (b) Array types, (c) Structure types, (d) Union types and (e) Function types.
0