Objective-C-Intro

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/130

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 8:55 PM on 4/6/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

131 Terms

1
New cards

Objective-C

General-purpose programming language built on C with Smalltalk features, making it object-oriented

2
New cards

Objective-C Primary Use

Used for developing iOS and Mac OS X operating systems and applications

3
New cards

Objective-C Origin

Developed by NeXT for NeXTSTEP OS and later adopted by Apple

4
New cards

Objective-C Example Code

Basic program using #import, main, and NSLog to print output

5
New cards

Foundation Framework

Provides extended data types like NSArray, NSDictionary, NSSet and utilities for files, strings, URLs, dates, and error handling

6
New cards

Purpose of Learning Objective-C

To become better at designing, implementing, and maintaining systems

7
New cards

Objective-C Advantage

Large iOS user base and growing Mac OS X ecosystem

8
New cards

Try It Option Online

Allows compiling and executing Objective-C code without local setup

9
New cards

Local Environment Setup

Requires a text editor and GCC compiler

10
New cards

Text Editor

Tool for writing code (e.g., Notepad, vim, EMACS)

11
New cards

Source File

File containing code, usually with .m extension

12
New cards

GCC Compiler

Converts human-readable code into machine-executable program

13
New cards

Objective-C Program Structure

Consists of preprocessor commands, interface, implementation, methods, variables, statements, and comments

14
New cards

Preprocessor Command

#import used to include header files before compilation

15
New cards

Interface

Defines class structure and methods using @interface

16
New cards

Implementation

Defines method behavior using @implementation

17
New cards

Method Declaration

Defined using - (returnType)methodName;

18
New cards

NSObject

Base class of all Objective-C objects

19
New cards

Main Function

Entry point of program execution (int main())

20
New cards

NSLog

Function used to print output to console

21
New cards

Return 0

Terminates program successfully

22
New cards

Comments

Ignored by compiler, written using / /

23
New cards

Objective-C Tokens

Smallest elements of a program (keywords, identifiers, constants, strings, symbols)

24
New cards

Example Tokens

NSLog, @, (, "Hello, World!", )

25
New cards

Semicolon (;)

Terminates statements

26
New cards

Comments Rule

Cannot be nested and not allowed inside strings

27
New cards

Identifier

Name for variables, functions, etc.

28
New cards

Identifier Rules

Must start with letter or underscore, followed by letters/digits/underscores

29
New cards

Invalid Identifier Characters

@, $, %

30
New cards

Case Sensitivity

Manpower and manpower are different

31
New cards

Valid Identifiers

mohd, zara, abc, move_name, a_123, myname50, _temp, j, a23b9, retVal

32
New cards

Objective-C Data Types

System for declaring variables/functions that defines storage size and data interpretation

33
New cards

Basic Types

Arithmetic types including integer and floating-point types

34
New cards

Enumerated Types

Define variables with specific discrete integer values

35
New cards

Void Type

Indicates no value

36
New cards

Derived Types

Includes pointers, arrays, structures, unions, and functions

37
New cards

Aggregate Types

Arrays and structures

38
New cards

Variable

Named storage location used to store data

39
New cards

Variable Type Role

Determines memory size, value range, and operations

40
New cards

Variable Naming Rules

Letters, digits, underscore; must start with letter or underscore

41
New cards

Case Sensitivity (Variables)

Uppercase and lowercase are different

42
New cards

char

Single byte integer

43
New cards

int

Natural integer size of machine

44
New cards

float

Single precision floating-point

45
New cards

double

Double precision floating-point

46
New cards

void

No type

47
New cards

Variable Definition

Specifies type and allocates storage

48
New cards

Syntax (Definition)

type variable_list;

49
New cards

Example Definition

int i, j, k;

50
New cards

Variable Initialization

Assigning value during declaration

51
New cards

Example Initialization

int d = 3, f = 5;

52
New cards

Variable Declaration

Tells compiler variable exists without allocating memory

53
New cards

extern Keyword

Used to declare variables defined elsewhere

54
New cards

Rule

Variable can be declared many times but defined once

55
New cards

Lvalue

Expression that can appear on left or right side of assignment

56
New cards

Rvalue

Expression that can only appear on right side

57
New cards

Valid Example

int g = 20;

58
New cards

Invalid Example

10 = 20;

59
New cards

Constants

Fixed values that cannot change during execution

60
New cards

Literal

Another term for constant values

61
New cards

Integer Literal

Whole number constants (decimal, octal, hexadecimal)

62
New cards

Decimal Literal

No prefix

63
New cards

Octal Literal

Prefix 0

64
New cards

Hexadecimal Literal

Prefix 0x or 0X

65
New cards

Integer Literal Suffix

U (unsigned), L (long)

66
New cards

Valid Integer Literal

212, 215u, 0xFeeL

67
New cards

Invalid Integer Literal

078, 032UU

68
New cards

Floating Literal

Numbers with decimal/exponent

69
New cards

Valid Floating Literal

3.14159, 314159E-5L

70
New cards

Invalid Floating Literal

510E, 210f, .e55

71
New cards

Character Literal

Single character in single quotes

72
New cards

Escape Sequence

Special characters with backslash

73
New cards

\

Backslash

74
New cards

'

Single quote

75
New cards

"

Double quote

76
New cards

?

Question mark

77
New cards

\a

Alert/bell

78
New cards

\b

Backspace

79
New cards

\f

Form feed

80
New cards

\n

Newline

81
New cards

\r

Carriage return

82
New cards

\t

Horizontal tab

83
New cards

\v

Vertical tab

84
New cards

\ooo

Octal value

85
New cards

\xhh

Hexadecimal value

86
New cards

String Literal

Characters inside double quotes

87
New cards

String Concatenation

Adjacent strings combine automatically

88
New cards

#define

Preprocessor used to define constants

89
New cards

const Keyword

Declares typed constant

90
New cards

Best Practice

Constants should be in uppercase

91
New cards

Operator

Symbol that performs mathematical or logical operations

92
New cards

Types of Operators

Arithmetic, Relational, Logical, Bitwise, Assignment, Misc

93
New cards

+

Adds two operands (A + B = 30)

94
New cards

-

Subtracts second operand from first (A - B = -10)

95
New cards

*

Multiplies operands (A * B = 200)

96
New cards

/

Divides numerator by denominator (B / A = 2)

97
New cards

%

Modulus, returns remainder (B % A = 0)

98
New cards

++

Increment by 1 (A++ = 11)

99
New cards

--

Decrement by 1 (A-- = 9)

100
New cards

==

True if equal (A == B is false)

Explore top notes

note
Excretory system
Updated 713d ago
0.0(0)
note
Module 1.5a Sleep: Consciousness
Updated 187d ago
0.0(0)
note
Chapter 14-Natural Resources
Updated 1040d ago
0.0(0)
note
Napoleon
Updated 1169d ago
0.0(0)
note
AP World Unit 2
Updated 349d ago
0.0(0)
note
Excretory system
Updated 713d ago
0.0(0)
note
Module 1.5a Sleep: Consciousness
Updated 187d ago
0.0(0)
note
Chapter 14-Natural Resources
Updated 1040d ago
0.0(0)
note
Napoleon
Updated 1169d ago
0.0(0)
note
AP World Unit 2
Updated 349d ago
0.0(0)

Explore top flashcards

flashcards
Así se dice 2 Cap. 2
51
Updated 1006d ago
0.0(0)
flashcards
List 1B
86
Updated 934d ago
0.0(0)
flashcards
Chapter 9- Management
91
Updated 1105d ago
0.0(0)
flashcards
Key Terms ITI Exam 2
58
Updated 784d ago
0.0(0)
flashcards
Exam 1
89
Updated 1149d ago
0.0(0)
flashcards
Economics
61
Updated 894d ago
0.0(0)
flashcards
Así se dice 2 Cap. 2
51
Updated 1006d ago
0.0(0)
flashcards
List 1B
86
Updated 934d ago
0.0(0)
flashcards
Chapter 9- Management
91
Updated 1105d ago
0.0(0)
flashcards
Key Terms ITI Exam 2
58
Updated 784d ago
0.0(0)
flashcards
Exam 1
89
Updated 1149d ago
0.0(0)
flashcards
Economics
61
Updated 894d ago
0.0(0)