Effective Objective-C 2.0:編寫高質量iOS與OS X代碼的52個有效方法 英文版

(美)Matt Galloway(馬特·加洛韋)

  • 出版商: 電子工業
  • 出版日期: 2016-03-01
  • 定價: $450
  • 售價: 8.5$383
  • 語言: 簡體中文
  • 頁數: 304
  • 裝訂: 平裝
  • ISBN: 7121272636
  • ISBN-13: 9787121272639
  • 相關分類: Apple Developer英文 English

已絕版

相關主題

商品描述

本書不是在講 Objective-C 語言的基礎知識,而是要講如何高效運用這門語言。全書共分 7 章,從7 個方面總結和探討了 Objective-C 編程中 52 個鮮為人知又容易被忽視的特性。第 1 章從整體上講解Objective-C 的核心概念;第 2 章講述了與面向對象語言的重要特徵(對象、消息和運行期)相關的行為;第 3 章介紹瞭如何編寫適合與 Objective-C 搭配的類;第 4 章講述協議與分類相關的技巧;第 5 章介紹內存管理的註意事項;第 6 章介紹塊與大中樞派發(Grand Central Dispatch)相關的技巧;第 7 章總覽了 Cocoa 和 Cocoa Touch 系統框架,並深入研究了其中的某些類。

作者簡介

Matt Galloway,是英國倫敦的一名iOS 開發人員。
他在2007 年畢業於劍橋大學彭布魯克學院,獲得工學碩士學位,研究方向是電子信息科學。自那時起,他一直從事編程,主要使用Objective-C。
從iOS 發布SDK 開始,他一直在iOS 上進行開發。
他的Twitter 賬號是@mattjgalloway,常常在Stack Overflow上回答問題。

目錄大綱

前言
致謝
關於作者
Chapter 1: Accustoming Yourself to Objective-C
Item 1: Familiarize Yourself with Objective-C's Roots
Item 2: Minimize Importing Headers in Headers
Item 3: Prefer Literal Syntax over the Equivalent Methods
Item 4: Prefer Typed Constants to Preprocessor # define
Item 5: Use Enumerations for States, Options, and Status Codes
Chapter 2: Objects, Messaging, and the Runtime
Item 6: Understand Properties
Item 7: Access Instance Variables Primarily Directly When
Accessing Them Internally
Item 8: Understand Object Equality
Item 9: Use the Class Cluster Pattern to Hide Implementation Detail
Item 10: Use Associated Objects to Attach Custom Data to Existing Classes
Item 11: Understand the Role of objc_msgSend
Item 12: Understand Message Forwarding
Item 13: Consider Method Swizzling to Debug Opaque Methods
Item 14: Understand What a Class Object Is
Chapter 3: Interface and API Design
Item 15: Use Prefix Names to Avoid Namespace Clashes
Item 16: Have a Designated Initializer
Item 17: Implement the description Method
Item 18: Prefer Immutable Objects
Item 19: Use Clear and Consistent Naming
Item 20: Prefix Private Method Names
Item 21 : Understand the Objective-C Error Model
Item 22: Understand the NSCopying Protocol
Chapter 4: Protocols and Categories
Item 23: Use Delegate and Data Source Protocols for Interobject Communication
Item 24: Use Categories to Break Class Implementations into Manageable Segments
Item 25: Always Prefix Category Names on Third-Party Classes
Item 26: Avoid Properties in Categories
Item 27: Use the Class- Continuation Category to Hide Implementation Detail
Item 28: Use a Protocol to Provide Anonymous Objects
Chapter 5: Memory Management
Item 29: Understand Reference Counting
Item 30: Use ARC to Make Reference Counting Easier
Item 31: Release References and Clean Up Observation State Only in dealloc
Item 32: Beware of Memory Management with Exception-Safe Code
Item 33: Use Weak References to Avoid Retain Cycles
Item 34: Use Autorelease Pool Blocks to Reduce High-Memory Waterline
Item 35: Use Zombies to Help Debug Memory-Management Problems
Item 36: Avoid Using retainCount
Chapter 6: Blocks and Grand Central Dispatch
Item 37: Understand Blocks
Item 38: Create typedefs for Common Block Types
Item 39: Use Handler Blocks to Reduce Code Separation
Item 40: Avoid Retain Cycles Introduced by Blocks Referencing the Object Owning Them
Item 41: Prefer Dispatch Queues to Locks for Synchronization
Item 42: Prefer GCD to performSelector and Friends
Item 43: Know When to Use GCD and When to Use Operation Queues
Item 44: Use Dispatch Groups to Take Advantage of Platform Scaling
Item 45: Use dispatch_once for Thread-Safe Single-Time Code Execution
Item 46: Avoid dispatch_get_current_queue
Chapter 7: The System Frameworks
Item 47: Familiarize Yourself with the System Frameworks
Item 48: Prefer Block Enumeration to for Loops
Item 49: Use Toll-Free Bridging for Collections with Custom Memory-Management Semantics
Item 50: Use NSCache Instead of NSDictionary for Caches
Item 51: Keep initialize and load Implementations Lean
Item 52: Remember that NSTimer Retains Its Target
Index