IOS 6 programming practices

Source: Internet
Author: User
Tags key string signal handler
Original Title: iOS 6 programming pushing the limits Author: (US) ROB Napier mugunth Kumar [Translator's introduction] Translator: chen xiaoliang Wu Haifeng Deng Qiang Zhou Qingcheng series name: Turing Program Design Series Press: People's post and telecommunications Press ISBN: 9787115312181 Release Date: April 2013 published: 16: 1-1 category: Computer> Software and programming> mobile development> other mobile development technologies
For more information, see "iOS 6 programming practices" Introduction to the constantly evolving computer books and iOS platform. This book is fully updated based on this and covers iOS 6 development in four parts. The first part mainly introduces the new functions of iOS 6. The second part shows you how to master common tools (including table view notifications and animation layers ), the content involves cocoa design patterns and ideas Apple uses to solve problems, manages memory through objective-C's arc, and correctly uses table views (including solving infinite scrolling and other issues), set view and automatic layout, custom drawing, view animation and core animation framework, error handling, and location service. Part 3 describes the tools and related technologies to be used in specific situations, including table views, multitasking, restful services, and security (using Key Strings, certificates, and passwords to protect applications and user data) adjust applications based on hardware and platform, easily create internationalization and localization, purchase in-app, and use instruments for performance tuning. The fourth part introduces more advanced development tools, including storyboards and custom switching effects, KVO, block and function programming, offline support, cloud, text layout, and core Foundation, finally, the objective-C is parsed in depth. IOS 6 Programming Practice is suitable for people with certain iOS development experience who are committed to in-depth understanding of iOS development, best practices, and others' practical development experience. Directory "iOS 6 programming practices" Part 1 new functions chapter 2 new system 2 1st new functions 2 1.1.1 set view 3 1.1.2 Automatic Layout 3 1.1.3 automatic reference count 3 1.1.4 Managed Content purchased in-app 4 1.1.5 social networking framework 4 1.1.6 UI status retained 4 1.1.7 other new features 4 1.2 Summary 6 1.3 extensions read 6 chapter 6 familiar with xcode 4 and llvm compiler 7 2nd understand user interface 8 2.1.1 label editor 9 2.1.2 key Binding changes 9 2.1.3 Project Settings editor 10 2.1.4 built-in version control system 10 2.1.5 work zone 10. 2.2 Single Window Working Mode 10 2.3 navigation panel 11 2.3.1 engineering navigation panel 12 2.3.2 symbol navigation panel 12 2.3.3 search navigation panel 12 2.3.4 problem navigation panel 12 2.3.5 debug navigation panel 12 2.3.6 breakpoint Navigation panel 12 2.3.7 log navigation panel 13 2.4 auxiliary functions 13 2.5 built-in interface builder 13 2.6 xcode core: llvm compiler 14 2.6.1 clang compiler front end 15 2.6.2 I am a bug! Fixed my 15 2.7 llvm 4 new feature 15 2.7.1 literal 15 2.7.2 literal and availability check 18 2.7.3 automatic merging of instance variables 18 2.8 use git for Version Control 19 2.8.1 built-in git Version Control system 19 2.8.2 version editor 19 2.8.3 git Best Practices 19 2.9 scheme 20 2.9.1 why use scheme 20 2.9.2 it is recommended to use scheme to implement your intent 21 2.9.3 create a scheme 21 2.9.4 share your scheme 22 2.10 add comments 22 2.10.1 create xcconfig file 22 2.10.2 refactor build configuration file 23 2.11 convert code to objective-C Code 23 2.12 xcode 4 organizer 25 2.12.1 automatic device provisio Ning 25 2.12.2 view crash log and console output 25 2.12.3 view application sandbox data 26 2.12.4 manage version library 26 2.12.5 manage application archive 26 2.12.6 view objective-C and SDK Documentation 26 2.13 Summary 26 2.14 extended reading 26 2.14.1 Apple document 26 2.14.2 WWDC lecture 27 2.14.3 blog 27 2.14.4 online resources 27 2.14.5 books 27 part 2 practices 3rd chapter objective-C basics 30 3.1 naming conventions 30 3.2 Automatic Reference count 32 3.3 attribute 35 3.3.1 attribute modifier keyword 36 3.3.2 attribute best practices 37 3.3.3 private instance variable 37 3.4 accessors 37 3.5 classification and extensions 38 3.5.1 + Load Method 40 3.5.2 Use Associated references for classification add data 40 3.5.3 Class extension 42 3.6 formal and informal protocols 42 3.7 summary 43 3.8 extensions read 44 3.8.1 Apple Documentation 44 3.8.2 other resources 44 chapter 4th cocoa design patterns 45 4.1 understand models? View? Controller 45 4.1.1 use model class 46 4.1.2 use View class 46 4.1.3 use controller class 47 4.2 understand delegate and Data Source 47 4.3 Use command mode 48 4.3.1 use target? Action 48 4.3.2 Use method signature and call 49 4.3.3 use trampoline 52 4.3.4 revoke 55 4.4 use observer mode 55 4.5 Use Singleton mode 58 4.6 Summary 60 4.7 extended read 60 4.7.1 Apple documentation 60 4.7.2 others resource 61 Chapter 5th introduction to objective-C's ARC Management memory 62 5.1 Objective-C's arc basics 62 5.1.1 history 62 5.1.2 manual reference counting and automatic reference counting 63 5.2 what is arc 63 5.2.1 integrate non-arc third-party code in the ARC Project 64 5.2.2 integrate the arc Code 64 5.2.4 in the arc Code 64 5.2.3 framework in the non-arc project arc empty declaration variable 67 5.2.5 objective-C naming convention 67 5.2.6 cover default behavior 67 5.2.7 free bridging 68 5.2.8 arc internal Principles 68 5.3 common arc transplant errors 69 5.4 summary 72 5.5 extensions read 72 5.5.1 Apple document 72 5.5.2 WWDC lecture 72 5.5.3 blog 73 6th chapter 74 familiar with the inheritance relationship of the uitableview class 74 6.1 familiar with the table view 75 6.2.1 uitableviewcontroller 75 6.2.2 uitableviewcell 75 6.2.3 improved the scrolling speed of the table view 75 6.2.4 custom non-repetitive form RMB 82 6.2.5 table view best solution: write concise code, simplified controller content 83 6.3 Summary 87 6.4 extensions read 87 6.4.1 Apple documentation 87 6.4.2 other resources Chapter 87 set view and Automatic Layout 88 7th set view 88 7.1.1 categories and protocols 88 7.1.2 example 89 7.1 automatic Layout 97 7.2.1 use automatic layout 98 7.2.2 learn about Automatic Layout 98 7.2.3 relative layout constraints 98 7.2.4 visual format language 101 7.2.5 debug layout error 102 7.3 summary 103 7.4 extensions read 104 7.14.1 Apple documentation 104 7.14.2 WWDC lecture 104 Chapter 1 drawing functions 8th 105 different Ios Drawing Systems 8.1 105 uikit and View Drawing cycle 8.2 106 View Drawing and view layout 8.3 108 custom View Drawing 8.4 8.4.1 drawing through uikit 108 8.4.2 path 109 8.4.3 understand coordinate system 111 8.4.4 Resize and content mode 114 8.4.5 deformation 115 8.4.6 use core graphics to draw 117 8.4.7 mix uikit and core graphics 120 8.4.8 manage graphics context 121 8.5 optimize uiview drawing 123 8.5.1 avoid drawing 123 8.5.2 cache and background drawing 123 8.5.3 custom drawing and pre-rendering 123 8.5.4 pixel alignment with Blur text 124 8.5.5 transparent, opacity and hiding 125 8.6 cglayer 125 8.7 summary 127 8.8 extended reading 127 8.8.1 Apple documentation 127 8.8.2 other resources 128 chapter 9th core animation 129 9.1 view animation 129 9.2 Management User Interaction 131 9.3 layer drawing 132 9.3.1 Direct setting content 134 9.3.2 display method 134 9.3.3 custom drawing 135 9.3.4 drawing 136 9.4 moving object 136 9.4.1 implicit animation 137 9.4.2 explicit animation 137 9.4.3 model and representation 138 9.4.4 about timing 140 9.5 3D animation 142 9.6 beautification layer 145 9.7 automatic animation with Action 146 9.8 add animation for Custom Attributes 147 core animation and thread 9.9 148 summary 9.10 149 extensions read 9.11 9.11.1 Apple documentation 149 9.11.2 other resources 149 149 chapter error handling 150 10.1 error handling mode 150 10.2 asserted 151 10.3 exception 153 10.4 capture and Report Program crash 153 10.5 error and nserror 154 10.6 error handling block 156 10.7 log 157 10.7.1 record sensitive information 158 10.7.2 Log File Retrieval 159 summary 10.8 159 extensions read 10.9 10.9.1 Apple documentation 159 10.9.2 other resources 159 Chapter 159 location service 11th 161 core location framework 11.1 11.1.1 get user location 161 11.1.2 use built-in compass obtain the user's forward direction 162 11.1.3 location service and user privacy 163 11.2 background location service 165 11.2.1 background location update 165 11.2.2 notice of significant location change 165 11.2.3 regional monitoring (geo-fencing) 167 11.3 position simulation 167 11.4 moment focus on Power Consumption 168 11.5 summary 168 11.6 extended reading 168 Part 3 selection tools Chapter 3 Table view common UI examples 12th 170 drop-down refresh 12.1 170 infinite scrolling 12.2 173 rows edit animation effects with keyboard 175 12.4 uitableview 177 12.5 practical application of table view animation 178 12.5.1 implement folding list 178 12.5.2 implement option drawer 180 12.5.3 use gesture reader 181 12.6 summary in Table View cells 181 12.7 extended reading 182 chapter 13th multi-task 183 13.1 Background running best practices: greater capabilities greater responsibilities 183 13.2 state Recovery System 185 13.2.1 test state Recovery System 186 13.2.2 selective addition 186 13.2.3 changes in application startup process 187 13.2.4 state recovery identifier 187 13.2.5 state encoder and State decoder 188 13.2.6 table view and set view 191 13.2.7 advanced applications of State Recovery System 192 13.3 introduction to multitasking and running cycles 192 13.4 multi-task development with operations 193 13.5 multi-task implementation with GCD 197 13.5.1 GCD and arc 198 13.5.2 source and timer 198 13.5.3 create synchronization point 199 13.5.4 queue target and priority 200 13.5.5 dispatch group 201 13.5.6 queue associated data 202 13.5.7 Dispatch Data 202 13.6 Summary 203 extensions read 13.7 13.7.1 apple documentation 203 13.7.2 WWDC lecture 203 13.7.3 other resources 203 chapter 14th rest confusing 204 14.1 rest Introduction 205 14.2 select Data Exchange Format 205 14.2.1 Parse XML 205 14.2.2 parse JSON 206 in IOS 14.2.3 XML and JSON 207 14.2.4 model version 208 14.3 hypothetical Web Service 208 14.4 important reminder 209 14.5 restfulengine architecture (iworkflow app sample code) 209 14.5.1 nsurlconnection and third-party framework 209 14.5.2 create restfulengine 210 14.5.3 use the access token to authenticate API calls 213 14.5.4 in restfulengine. in M, override related methods to add custom authentication header 213 14.5.5 cancel request 214 14.5.6 Request Response 214 14.5.7 perform key-value encoding on JSON data 215 14.5.8 list page JSON object and detailed page JSON object 217 14.5.9 nested JSON object 217 14.5.10 less is more than 219 14.5.11 error handling 219 14.5.12 localization 221 14.5.13 use classification processing other formats 221 14.5.14 tips for improving performance in IOS 222 14.6 summary 222 14.7 extensions read 222 14.7.1 Apple documentation 222 14.7.2 other resources 223 chapter 15th consolidate system security through security services 224 15.1 understand IOS sandbox 224 15.2 Ensure network communication security 225 15.2.1 how certificates work 226 15.2.2 test certificates 228 15.2.3 certificate reliability 231 15.3 use File Protection 233 use key string 15.4 234 use encryption 15.5 15.5.1 AES summary 236 15.5.2 use pbkdf2 to convert password to key 237 15.5.3 AES mode and fill 239 15.5.4 initialization vector 240 15.5.5 use HMAC for authentication 241 15.5.6 incorrect password 241 15.5.7 Single-Slot encryption 242 15.5.8 improved commoncrypto performance 244 15.5.9 combined encryption and compression 247 summary 15.6 247 extended reading 248 15.7.1 Apple documentation 248 15.7.2 WWDC lecture 248 15.7.3 other resources Chapter 248 running applications on multiple Apple platforms and Apple devices 16th 249 developing multi-platform applications 16.1 16.1.1 configurable target settings: considerations when base SDK and deployment target 250 16.1.2 support multiple sdks: framework, category and method 250 16.1.3 check framework, class and method availability 252 16.2 detection device function 253 16.2.1 detection device and judgment function 253 16.2.2 detection hardware and sensor 254 16.3 send email in Application and text message 258 16.4 check multitasking support 258 16.5 support iPhone 5 259 16.6 uirequireddevicecapabilities 260 summary 16.7 261 extensions read 16.8 16.8.1 Apple documentation 262 16.8.2 other resources 262 chapter 262 internationalization and localization 17th 263 what is localization 263 17.2 localized string 264 17.3 Review of unlocalized strings 265 17.4 formatting numbers and dates 266 17.5 nib files and base internationalization 269 17.6 localized complex strings 270 summary 17.7 272 extensions read 17.8 17.8.1 Apple documentation 272 17.8.2 WWDC lecture 272 chapter 18th improve sales performance through in-APP purchase 273 18.1 before the start 273 what to buy in-app 18.2 what to buy in-app 273 what to buy in-app 274 what to buy in-APP purchase prohibited to sell products 18.2.2 re think about your business model 275 18.3 set product configuration 275 18.3.1 on iTunes connect Step 1: create a new app ID 276 18.3.2 For your app Step 2: generate the configuration file 277 18.3.3 Step 3: Create the app product item 277 18.3.4 Step 4: create an in-APP purchase product item 278 18.3.5 Step 5: generate a shared key 279 18.3.6 Step 6: Create a test account 279 18.3.7 Step 7: create Managed Content 279 18.4 implement in-APP purchase 281 18.5 mkstorekit introduction 281 18.5.1 why use mkstorekit 281 18.5.2 mkstorekit design 282 18.5.3 custom mkstorekit 283 implement purchase 18.6 download hosting content 285 test code 286 18.9 troubleshooting 286 18.9.1 invalid product ID 286 18.9.2 unable to connect to iTunes store 286 18.9.3 you have purchased this product, but it hasn't downloaded 287 18.10 summary 287 18.11 extensions read 287 18.11.1 Apple documentation 287 18.11.2 blog 287 18.11.3 other resources chapter 287 debugging 19th 288 lldb 19.1 288 use lldb for debugging 19.2 19.2.1 dsym file 288 19.2.2 symbolic 290 19.3 breakpoint 291 19.4 observation point 294 19.5 lldb console 295 19.6 crash mark 298 different crash types 19.7 19.7.1 crash 299 19.7.2 SIGSEGV 299 19.7.3 sigbus 300 19.7.4 sigtrap 300 19.7.5 crash 300 19.7.6 sigill 300 19.7.7 SIGABRT 301 19.7.8 watchdog timeout 301 19.7.9 custom error signal handler 301 19.8 collection crash report 302 19.9 third-party crash report service 303 summary 19.10 303 extensions read 19.11 19.11.1 Apple documentation 304 19.11.2 WWDC lecture 304 19.11.3 other resources 304 chapter 20th Performance Tuning 305 20.1 performance thinking model 305 Guidelines 1: 305 guidelines 2: devices exist for the convenience of users 305 Guidelines 3: To achieve the ultimate 305 guidelines 4: user perception is the actual 306 guideline 5: focus on areas that can bring big benefits 306 20.2 Welcome to the world of instruments 306 20.3 search for memory problems 308 20.4 search for CPU problems 311 1274.1 accelerate framework 314 1094.2 glkit 315 Drawing Performance 20.5 315 optimized disk access and network access 317 20.7 summary 318 20.8 extensions read 318 copyright 8.1 Apple documentation 318 copyright 8.2 other resources 318 Part 4 beyond the limit chapter 21st storyboards and custom switching effects 320 21.1 initial knowledge storyboards 320 21.1.1 instantiation stories board 321 21.1.2 load View Controller 321 21.1.3 connecting line 321 21.1.4 use a storyboard to implement table view 323 21.2 custom switching effect 324 21.2.1 another advantage 325 21.2.2 baibi weituan 326 21.3 use uiappearance Protocol custom view 326 21.4 summary 327 21.5 extended reading 327 21.5.1 Apple document 327 21.5.2 WWDC lecture 327 21.5.3 other resources Chapter 327 cocoa tips: key Value encoding and observation 328 22.1 key value encoding 328 22.1.1 KVC assignment 330 22.1.2 Key Path Traversal attribute 331 22.1.3 KVC and container class 331 22.1.4 KVC and dictionary 335 22.1.5 KVC and non-object 336 22.1.6 KVC implements high-order message transfer 336 22.1.7 container operator 336 22.2 337 key value observation 339 22.2.1 KVO and container class 340 22.2.2 how KVO is implemented 22.3 340 KVO trade-offs 22.4 342 summary 22.5 342 extensions read 22.5.1 apple document 342 22.5.2 other resources Chapter 342 different ideas: block and functional programming 343 23.1 what is block 343 23.1.1 why use functional programming 343 23.1.2 "functional" uialertview 344 23.2 declare block 345 23.2.1 variable scope 346 23.2.2 stack and heap 346 23.3 implementation block 347, block 23.4, and concurrency 349 23.4.1 dispatch queue 349 23.4.2 nsoperationqueue and GCD dispatch queue 350 23.5 block-based cocoa method 351 23.5.1 uiview animation use block 351 23.5.2 to display and remove view Controllers 352 23.5.3 tweetcomposer and send emails (text messages) in the application) 352 23.5.4 use nsdictionary's Enum erationwithblock to traverse the dictionary 352 23.5.5 search for block-based methods 353 23.6 353 support 23.7 Summary 353 23.8 extensions read 354 23.8.1 Apple documentation 354 23.8.2 blog 354 23.8.3 other resources 354 24th chapter offline support 355 24.1 reasons for offline support 355 24.2 Cache Policy 356 24.2.1 storage cache 356 24.2.2 Cache version and invalidation 359 24.3 Data Model cache 359 24.4 Cache version control 363 creation of memory cache 24.5 24.5.1 designed the memory cache for appcache 365 24.5.2 Processing Memory warning 366 24.5.3 processing ended and enters the background notification 367 24.6 create URL cache 367 24.6.1 expired model 368 24.6.2 Verification Model 368 24.6.3 example 368 24.6.4 use URL Cache to Cache images 369 24.7 summary 369 24.8 extensions read 369 24.8.1 Apple documentation 369 24.8.2 books 369 24.8.3 other resources 369 chapter 25th cloud data 370 25.1 370 iCloud 25.2 372 third-party cloud service providers 25.3 373 parse 25.3.1 parse getting started 373 25.3.2 top-level object of parse 374 25.3.3 code 374 25.4 stackmob 376 25.4.1 set stackmob 376 25.4.2 logging on, uploading and obtaining data 377 25.4.3 stackmob custom code 377 25.5 disadvantages of backend services 378 25.6 summary 378 25.7 extended reading 378 25.7.1 Apple documentation 378 25.7.2 WWDC lecture 378 25.7.3 other resources 379 chapter 26th exquisite text layout 380 basic controls: field, view, and tag 380 26.2 Rich Text 381 26.2.1 in uikit understand bold, italic, and underline 381 26.2.2 attribute string 382 26.2.3 paragraph style 384 26.2.4 attribute string and HTML 384 26.3 use Web View show Rich Text 385 26.3.1 show and access HTML 385 26.3.2 respond to user interaction in Web View 386 26.3.3 draw Web View 386 26.4 core text 387 26.4.1 using ctframesetter in scroll view and table View layout 387 26.4.2 non-continuous path creation framework 388 26.4.3 typeset, text lines, continuous text and fonts 390 26.4.4 draw text 391 26.5 summary 395 26.6 extensions read 395 26.6.1 Apple documentation 395 26.6.2 WWDC lecture 395 26.6.3 other resources Chapter 396 create core Foundation application 27th 397 core foundation type 27.1 397 naming and memory management 27.2 398 distributor 27.3 399 introspection 27.4 400 27.5 strings and data 400 27.5.1 constant string 401 27.5.2 create string 401 27.5.3 convert to C string 402 27.5.4 other string operators 404 27.5.5 string storage 404 27.5.6 cfdata 405 27.6 405 container type 406 27.6.1 cfarray 406 27.6.2 cfdictionary 406 27.6.3 cfset and cfbag 27.6.4 other container types 407 27.6.5 callback functions 407 27.7 free bridging 408 27.8 summary 411 27.9 extensions read 411 27.9.1 Apple documentation 411 27.9.2 other resources 411 chapter 28th deep parsing objective-C 412 28.1 understanding classes and objects 412 28.2 how to use methods and attributes 414 28.3 how message passing works 416 28.3.1 dynamic implementation 417 28.3.2 fast forwarding 419 28.3.3 normal forwarding 422 28.3.4 forwarding failure 422 28.3.5 mixed write 423 for various versions of objc_msgsend 28.4 28.5 ISA mixed write 426 28.6 method mixed write and ISA mixed write 427 28.7 summary 427 28.8 extended read 427 28.8.1 Apple documentation 427 28.8.2 other resources 428 index 429 Book Information Source: china Interactive publishing network
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.