The Notes for Professionals book is compiled from Stack Overflow Documentation, the content is written by the beautiful people at Stack Overflow. Text content is released under Creative Commons BY-SA. See credits at the end of this book whom contributed to the various chapters. Images may be copyright of their respective owners unless otherwise specified
Book created for educational purposes and is not affiliated with group(s), company(s) nor Stack Overflow. All trademarks belong to their respective company owners
https://goalkicker.com/
章节目录
1-1
Content list
1-2
About
1-3
Chapter 1: Getting started with Objective-C Language
1-4
Section 1.1: Hello World
1-5
Chapter 2: Basic Data Types
1-6
Section 2.1: SEL
1-7
Section 2.2: BOOL
1-8
Section 2.3: id
1-9
Section 2.4: IMP (implementation pointer)
1-10
Section 2.5: NSInteger and NSUInteger
1-11
Chapter 3: Enums
1-12
Section 3.1: typedef enum declaration in Objective-C
1-13
Section 3.2: Converting C++ std::vector<Enum> to an Objective-C Array
1-14
Section 3.3: Defining an enum
1-15
Chapter 4: Structs
1-16
Section 4.1: Defining a Structure and Accessing Structure Members
1-17
Section 4.2: CGPoint
1-18
Chapter 5: Classes and Objects
1-19
Section 5.1: Dierence between allocation and initialization
1-20
Section 5.2: Creating classes with initialization values
1-21
Section 5.3: Specifying Generics
1-22
Section 5.4: Singleton Class
1-23
Section 5.5: The "instancetype" return type
1-24
Chapter 6: Inheritance
1-25
Section 6.1: Car is inherited from Vehicle
1-26
Chapter 7: Methods
1-27
Section 7.1: Class methods
1-28
Section 7.2: Pass by value parameter passing
1-29
Section 7.3: Pass by reference parameter passing
1-30
Section 7.4: Method parameters
1-31
Section 7.5: Create a basic method
1-32
Section 7.6: Return values
1-33
Section 7.7: Calling methods
1-34
Section 7.8: Instance methods
1-35
Chapter 8: Properties
1-36
Section 8.1: Custom getters and setters
1-37
Section 8.2: Properties that cause updates
1-38
Section 8.3: What are properties?
1-39
Chapter 9: Random Integer
1-40
Section 9.1: Basic Random Integer
1-41
Section 9.2: Random Integer within a Range
1-42
Chapter 10: BOOL / bool / Boolean / NSCFBoolean
1-43
Section 10.1: BOOL/Boolean/bool/NSCFBoolean
1-44
Section 10.2: BOOL VS Boolean
1-45
Chapter 11: Continue and Break!
1-46
Section 11.1: Continue and Break Statement
1-47
Chapter 12: Key Value Coding / Key Value Observing
1-48
Section 12.1: Most Common Real Life Key Value Coding Example
1-49
Section 12.2: Querying KVC Data
1-50
Section 12.3: Collection Operators
1-51
Section 12.4: Key Value Observing
1-52
Chapter 13: NSString
1-53
Section 13.1: Encoding and Decoding
1-54
Section 13.2: String Length
1-55
Section 13.3: Comparing Strings
1-56
Section 13.4: Splitting
1-57
Section 13.5: Searching for a Substring
1-58
Section 13.6: Creation
1-59
Section 13.7: Changing Case
1-60
Section 13.8: Removing Leading and Trailing Whitespace
1-61
Section 13.9: Joining an Array of Strings
1-62
Section 13.10: Formatting
1-63
Section 13.11: Working with C Strings
1-64
Section 13.12: Reversing a NSString Objective-C
1-65
Chapter 14: NSArray
1-66
Section 14.1: Creating Arrays
1-67
Section 14.2: Accessing elements
1-68
Section 14.3: Using Generics
1-69
Section 14.4: Reverse an Array
1-70
Section 14.5: Converting between Sets and Arrays
1-71
Section 14.6: Converting NSArray to NSMutableArray to allow modification
1-72
Section 14.7: Looping through
1-73
Section 14.8: Enumerating using blocks
1-74
Section 14.9: Comparing arrays
1-75
Section 14.10: Filtering Arrays With Predicates
1-76
Section 14.11: Sorting array with custom objects
1-77
Section 14.12: Sorting Arrays
1-78
Section 14.13: Filter NSArray and NSMutableArray
1-79
Section 14.14: Add objects to NSArray
1-80
Section 14.15: Finding out the Number of Elements in an Array
1-81
Section 14.16: Creating NSArray instances
1-82
Chapter 15: NSMutableArray
1-83
Section 15.1: Sorting Arrays
1-84
Section 15.2: Creating an NSMutableArray
1-85
Section 15.3: Adding elements
1-86
Section 15.4: Insert Elements
1-87
Section 15.5: Deleting Elements
1-88
Section 15.6: Move object to another index
1-89
Section 15.7: Filtering Array content with Predicate
1-90
Chapter 16: NSDictionary
1-91
Section 16.1: Create
1-92
Section 16.2: Fast Enumeration
1-93
Section 16.3: Creating using literals
1-94
Section 16.4: Creating using dictionaryWithObjectsAndKeys:
1-95
Section 16.5: NSDictionary to NSArray
1-96
Section 16.6: NSDictionary to NSData
1-97
Section 16.7: NSDictionary to JSON
1-98
Section 16.8: Creating using plists
1-99
Section 16.9: Setting a Value in NSDictionary
1-100
Section 16.10: Getting a Value from NSDictionary
1-101
Section 16.11: Check if NSDictionary already has a key or not
1-102
Section 16.12: Block Based Enumeration
1-103
Chapter 17: NSMutableDictionary
1-104
Section 17.1: NSMutableDictionary Example
1-105
Section 17.2: Removing Entries From a Mutable Dictionary
1-106
Chapter 18: NSDate
1-107
Section 18.1: Convert NSDate that is composed from hour and minute (only) to a full NSDate
1-108
Section 18.2: Converting NSDate to NSString
1-109
Section 18.3: Creating an NSDate
1-110
Section 18.4: Date Comparison
1-111
Chapter 19: NSURL
1-112
Section 19.1: Create
1-113
Section 19.2: Compare NSURL
1-114
Section 19.3: Modifying and Converting a File URL with removing and appending path
1-115
Chapter 20: NSUrl send a post request
1-116
Section 20.1: Simple POST request
1-117
Section 20.2: Simple Post Request With Timeout
1-118
Chapter 21: NSData
1-119
Section 21.1: Create
1-120
Section 21.2: NSData and Hexadecimal String
1-121
Section 21.3: Get NSData length
1-122
Section 21.4: Encoding and decoding a string using NSData Base64
1-123
Chapter 22: NSPredicate
1-124
Section 22.1: Filter By Name
1-125
Section 22.2: Find movies except given ids
1-126
Section 22.3: Find all the objects which is of type movie
1-127
Section 22.4: Find Distinct object ids of array
1-128
Section 22.5: Find movies with specific ids
1-129
Section 22.6: Case Insensitive comparison with exact title match
1-130
Section 22.7: Case sensitive with exact title match
1-131
Section 22.8: Case Insensitive comparison with matching subset
1-132
Chapter 23: NSRegularExpression
1-133
Section 23.1: Check whether a string matches a pattern
1-134
Section 23.2: Find all the numbers in a string
1-135
Chapter 24: NSJSONSerialization
1-136
Section 24.1: JSON Parsing using NSJSONSerialization Objective-C
1-137
Chapter 25: NSCalendar
1-138
Section 25.1: System Locale Information
1-139
Section 25.2: Initializing a Calendar
1-140
Section 25.3: Calendrical Calculations
1-141
Chapter 26: NSAttributedString
1-142
Section 26.1: Using Enumerating over Attributes in a String and underline part of string
1-143
Section 26.2: Creating a string that has custom kerning (letter spacing) editshare
1-144
Section 26.3: Create a string with text struck through
1-145
Section 26.4: How you create a tri-color attributed string
1-146
Chapter 27: NSTimer
1-147
Section 27.1: Storing information in the Timer
1-148
Section 27.2: Creating a Timer
1-149
Section 27.3: Invalidating a timer
1-150
Section 27.4: Manually firing a timer
1-151
Chapter 28: NSObject
1-152
Section 28.1: NSObject
1-153
Chapter 29: NSSortDescriptor
1-154
Section 29.1: Sorted by combinations of NSSortDescriptor
1-155
Chapter 30: NSTextAttachment
1-156
Section 30.1: NSTextAttachment Example
1-157
Chapter 31: NSCache
1-158
Section 31.1: NSCache
1-159
Chapter 32: NSUserDefaults
1-160
Section 32.1: Simple example
1-161
Section 32.2: Clear NSUserDefaults
1-162
Chapter 33: Subscripting
1-163
Section 33.1: Subscripts with NSArray
1-164
Section 33.2: Custom Subscripting
1-165
Section 33.3: Subscripts with NSDictionary
1-166
Chapter 34: Low-level Runtime Environment
1-167
Section 34.1: Augmenting methods using Method Swizzling
1-168
Section 34.2: Attach object to another existing object (association)
1-169
Section 34.3: Calling methods directly
1-170
Chapter 35: Fast Enumeration
1-171
Section 35.1: Fast enumeration of an NSArray with index
1-172
Section 35.2: Fast enumeration of an NSArray
1-173
Chapter 36: Categories
1-174
Section 36.1: Conforming to protocol
1-175
Section 36.2: Simple Category
1-176
Section 36.3: Declaring a class method
1-177
Section 36.4: Adding a property with a category
1-178
Section 36.5: Create a Category on XCode
1-179
Chapter 37: Protocols
1-180
Section 37.1: Optional and required methods
1-181
Section 37.2: Checking existence of optional method implementations
1-182
Section 37.3: Forward Declarations
1-183
Section 37.4: Conforming to Protocols
1-184
Section 37.5: Basic Protocol Definition
1-185
Section 37.6: Check conforms Protocol
1-186
Chapter 38: Protocols and Delegates
1-187
Section 38.1: Implementation of Protocols and Delegation mechanism
1-188
Chapter 39: Blocks
1-189
Section 39.1: Block Typedefs
1-190
Section 39.2: Blocks as Properties
1-191
Section 39.3: Blocks as local variables
1-192
Section 39.4: Blocks as Method Parameters
1-193
Section 39.5: Defining and Assigning
1-194
Chapter 40: XML parsing
1-195
Section 40.1: XML Parsing
1-196
Chapter 41: Declare class method and instance method
1-197
Section 41.1: How to declare class method and instance method
1-198
Chapter 42: Predefined Macros
1-199
Section 42.1: Predefined Macros
1-200
Chapter 43: Grand Central Dispatch
1-201
Section 43.1: What is Grand central dispatch
1-202
Chapter 44: Format-Specifiers
1-203
Section 44.1: Integer Example - %i
1-204
Chapter 45: Logging
1-205
Section 45.1: Logging
1-206
Section 45.2: NSLog Output Format
1-207
Section 45.3: Removing Log Statements from Release Builds
1-208
Section 45.4: Logging Variable Values
1-209
Section 45.5: Empty message is not printed
1-210
Section 45.6: Using __FUNCTION __
1-211
Section 45.7: NSLog vs printf
1-212
Section 45.8: Logging NSLog meta data
1-213
Section 45.9: NSLog and BOOL type
1-214
Section 45.10: Logging by Appending to a File
1-215
Chapter 46: Error Handling
1-216
Section 46.1: Error & Exception handling with try catch block
1-217
Section 46.2: Asserting
1-218
Chapter 47: Modern Objective-C
1-219
Section 47.1: Literals
1-220
Section 47.2: Container subscripting
1-221
Chapter 48: Singletons
1-222
Section 48.1: Using Grand Central Dispatch (GCD)
1-223
Section 48.2: Creating Singleton and also preventing it from having multiple instance using alloc/init, new
1-224
Section 48.3: Creating Singleton class and also preventing it from having multiple instances using alloc/init
1-225
Chapter 49: Multi-Threading
1-226
Section 49.1: Creating a simple thread
1-227
Section 49.2: Create more complex thread
1-228
Section 49.3: Thread-local storage
1-229
Chapter 50: Unit testing using Xcode
1-230
Section 50.1: Note:
1-231
Section 50.2: Testing a block of code or some method:
1-232
Section 50.3: Testing asynchronous block of code:
1-233
Section 50.4: Measuring Performance of a block of code:
1-234
Section 50.5: Running Test Suits:
1-235
Chapter 51: Memory Management
1-236
Section 51.1: Memory management rules when using manual reference counting