Effective Objective-C is a book that anyone who reads it will understand how important it is

  • At present, I am reading the second time, and write down my own reading notes, playing a record and remind the role, the content is mainly a simple summary, few examples, if not clear, strongly suggest to see the original book. Of course, for ebook lovers, here is the ebook version.

Chapter 1 familiarize yourself with Objective-C

OC is based on THE C language to add object-oriented features

1. Objective-c origins and nature

2, @class or import

3, use,@Literal grammar

4. How to use macro define

5, the enumeration

Chapter 2 Objects, Messages and runtime

  1. In object-oriented languages, objects are “building blocks” through which developers store and transfer data.
  2. The process of passing data between objects and performing tasks is called “messaging”
  3. Runtime environment: Code written by the developer that provides important functions for passing messages between objects and contains all the logic used to create class instances

6. Copy and strong attributes

7,.grammar

8. Determine object equality=

Class clusters and factory patterns

10. Association properties

11. OC message sending

12. Message forwarding

13. Black Magic Method Swizzling

14. OC objects

Chapter 3 interface and API design

If you want to reuse code, you need to write interfaces in a form that is easy to reuse, including naming, coding conventions, and so on.

15. Name prefixes

16, init

17, the description,

18, readonly

How do you name it

20. Private methods

21. Exceptions and errors

Copy is a shallow copy or a very copy

Chapter iv Agreement and Classification

OC does not support multiple inheritance (inheriting from different classes), so we define a set of methods that a class should implement in the protocol. The OC runtime system is highly dynamic, so you can take advantage of classes to add methods directly to the current class without inheriting subclasses.

Protocol delegate

24-27. Use categories well

28,idAnonymous objects

Chapter 5 Memory Management

29, 36, directionretainCountsay NO

30. What is ARC

31,deallocWhat’s in there?

33, circular reference solution

34. A quick look at @Autoreleasepool

35. What exactly is a zombie object

Chapter 6 Block and great central distribution

  • A block is a lexical closure that can be used in C, C++, and OC code to pass code as an object.
  • GCD provides an abstraction of threads based on a “dispatch queue.” The GCD creates, reuses, and destroys background threads as appropriate to handle each queue, depending on system resources.

37. Block concept

38, declare block

Block or delegate

41. Locks in iOS

GCD replaces performSelector

43, NSOperation

44. Introduction to the Methods of the Dispatch Group

45. Dispatch_once implements a singleton

Chapter 7 System Framework

As long as you write OC code, you can’t leave the system framework

Be familiar with the system framework

48. Four traversal methods

49, Use __bridge seamless bridge

50. Cache NSCache

Initialize and load you should know

A little knowledge of NSTimer

[will]