Mastering Objective C is a detailed guide for beginners that gives a modern programmer's viewpoint on Objective-C. It introduces the principles of Objective-C and current Apple programming skills and libraries allowing the reader to make the best use of the tools available. Concise and easy to understand, this book covers many topics including, introduction to key concepts of language, primary toolkits, as well as the Foundation and AppKit frameworks to help quickly advance with the necessary information. This book explains how to structure applications properly and organize code for optimum performance. The fundamental principles explained here are helpful for beginner and volunteer users interested in learning this highly technological and diverse language
Author(s): Sufyan bin Uzayr
Publisher: CRC Press
Year: 2023
Language: English
Pages: 246
Cover
Half Title
Series Page
Title Page
Copyright Page
Dedication
Contents
About the Editor
Acknowledgments
Zeba Academy – Mastering Computer Science
Chapter 1: Objective-C Overview
WHY CHOOSE OBJECTIVE-C?
ADVANTAGES AND DISADVANTAGES
Advantages
Disadvantages
FACTORS TO CONSIDER
DIFFERENTIATING OBJECTIVE-C FROM C++
DIFFERENTIATING OBJECTIVE-C VERSUS SWIFT
FRAMEWORK FOR THE FOUNDATION
LEARNING OBJECTIVE-C
USING OBJECTIVE-C
OBJECT-ORIENTED PROGRAMMING
INSTANCE, OBJECT, AND CLASS
RETURN TO THE CUSTOMIZE TABLE CELL
MAKING THE RECIPE CLASS
Set up the Array of Recipe Objects
A Recipes Array Is Replacing TableData
WHAT DOES A COMPILER DO?
PREPROCESSING
CUSTOM MACROS
TOKENIZATION (LEXING)
PARSING
STATIC ANALYSIS
TYPE CHECKING
OTHER ANALYSES
CREATING CODE
OPTIMIZATIONS
OBJECTIVE-C DEVELOPERS’ C# PRIMER
INTEROP OBJECTIVE-C
COMPARISON OF LANGUAGES
INTERFACES VS. PROTOCOLS
EXTENSION METHODS VS CATEGORIES
ASSEMBLIES VS. FRAMEWORKS
NAMED PARAMETERS VS. SELECTORS
NAMESPACES AND HEADERS
PROPERTIES
STATIC KEYWORD
LIST VS NSARRAY INITIALIZATION
LAMBDA EXPRESSIONS VS BLOCKS
NOTES
Chapter 2: Environment Setup and Program Structure
CONFIGURING THE OBJECTIVE-C ENVIRONMENT
CONFIGURATION OF THE LOCAL ENVIRONMENT
EDITOR OF TEXT
GCC COMPILER
UNIX/LINUX INSTALLATION
Mac OS INSTALLATION
LAUNCHING Xcode
WINDOWS INSTALLATION
STRUCTURE OF THE OBJECTIVE-C PROGRAM
Objective-C Example of Hello Everyone
USING Xcode TO CREATE AN OBJECTIVE-C APPLICATION
USING THE COMMAND LINE TO COMPILE OBJECTIVE-C
FILENAME EXTENTION
USING THE TERMINAL
FIRST PROGRAM’S EXPLANATION
DISPLAYING THE VALUES OF VARIABLES
CLASSES, OBJECTS, AND METHODS
WHAT EXACTLY IS AN OBJECT?
INSTANCES AND METHODS
AN OBJECTIVE-C CLASS FOR THE WORKING WITH FRACTIONS
@interface SECTION
CLASS AND INSTANCE METHODS
RETURN VALUES
METHOD ARGUMENTS
THE @implementation SECTION
PROGRAM SECTION
ACCESSING INSTANCE VARIABLES AND DATA ENCAPSULATION
NOTE
Chapter 3: Basic Syntax
OBJECTIVE-C TOKENS
SEMICOLONS;
COMMENTS
IDENTIFIERS
KEYWORDS
WHITESPACE IN OBJECTIVE-C
DATA TYPES
TYPES OF INTEGERS
TYPES OF FLOATING-POINT
VOID TYPE
VARIABLES IN OBJECTIVE-C
VARIABLE DEFINITION
VARIABLE DECLARATION
LVALUES AND RVALUES
CONSTANTS IN OBJECTIVE-C
INTEGER LITERALS
FLOATING-POINT LITERALS
CHARACTER CONSTANTS
STRING LITERALS
CONSTANT DEFINITION
#define Preprocessor
const Keyword
Chapter 4: Data Types
DATA TYPES AND CONSTANTS
TYPE int
TYPE float
TYPE char
QUALIFIERS: long, long long, short, unsigned, and signed
TYPE id
THE void TYPE
Chapter 5: Variables
OBJECTIVE-C VARIABLE DEFINITION
OBJECTIVE-C VARIABLE DECLARATION
OBJECTIVE-C LVALUES AND RVALUES
Chapter 6: Constants
CONSTANTS IN OBJECTIVE-C
INTEGER LITERALS
FLOATING-POINT LITERALS
CHARACTER CONSTANTS
STRING LITERALS
CONSTANT DEFINITION
#define Preprocessor
const Keyword
Chapter 7: Operators
ARITHMETIC OPERATORS IN OBJECTIVE-C
OPERATOR PRECEDENCE
UNARY MINUS OPERATOR AND INTEGER ARITHMETIC
THE MODULUS OPERATOR
INTEGER AND FLOATING-POINT CONVERSIONS
TYPE CAST OPERATOR
RELATIONAL OPERATORS
LOGICAL OPERATORS IN OBJECTIVE-C
BITWISE OPERATORS
ASSIGNMENT OPERATORS
MISC OPERATORS ↦ SIZEOF & TERNARY
OPERATORS’ PRECEDENCE IN THE OBJECTIVE-C
CALCULATOR CLASS
Chapter 8: Loops and Control Statement
THE for Statement
RELATIONAL OPERATORS
KEYBOARD INPUT
Nested for Loops
for Loop Variants
THE while Statement
THE do Statement
do-while Loop
THE break Statement
continue Statement
Chapter 9: Decision Making
THE if Statement
THE if-else CONSTRUCT
COMPOUND RELATIONAL TESTS
Nested if Statements
THE else if Construct
THE switch Statement
BOOLEAN VARIABLES
THE CONDITIONAL OPERATOR
Chapter 10: Functions
FUNCTIONS IN OBJECTIVE-C
CREATING A METHOD
DECLARATIONS OF METHOD
CALLING A METHOD
FUNCTION ARGUMENTS
APPRAISAL
BIBLIOGRAPHY
INDEX