Sams Teach Yourself Cocoa Touch Programming in 24 Hours

Paperback
from $0.00

Author: Sengan Baring-Gould

ISBN-10: 067233125X

ISBN-13: 9780672331251

Category: Personal Computers

In Full Color\ Code samples are syntax highlighted as in Xcode!!\ In just 24 sessions of one hour or less, learn how to build powerful mobile applications with Apple’s Cocoa Touch technology for the iPhone and iPod touch! Using this book’s straightforward, step-by-step approach, you’ll master every skill and technology you need, from handling user interaction and building effective user interfaces to accessing the Internet, playing media, and using the iPhone and iPod touch’s incredible...

Search in google:

In Full ColorCode samples are syntax highlighted as in Xcode!!In just 24 sessions of one hour or less, learn how to build powerful mobile applications with Apple’s Cocoa Touch technology for the iPhone and iPod touch! Using this book’s straightforward, step-by-step approach, you’ll master every skill and technology you need, from handling user interaction and building effective user interfaces to accessing the Internet, playing media, and using the iPhone and iPod touch’s incredible sensing capabilities. Each lesson builds on what you’ve already learned, giving you a rock-solid foundation for real-world success!Step-by-step instructions carefully walk you through the most common Cocoa Touch programming tasks.Quizzes and Exercises at the end of each chapter help you test your knowledge.By the Way notes present interesting information related to the discussion.Did You Know? tips offer advice or show you easier ways to perform tasks.Watch Out! cautions alert you to possible problems and give you advice on how to avoid them. Write simple, efficient code that reflects a clear understanding of how Cocoa Touch works and why it works that way Build great iPhone/iPod touch user interfaces from the ground up Display tables and provide for clear navigation Access the Internet and networks and show web pages Save and retrieve data, including user preferences Understand how the Cocoa Touch runtime loop interacts with your application Draw and manipulate images Create complex animations such as Cover Flow Build applications that play and record media Use the iPhone’s built-in accelerometer, GPS capabilities, and WiFi support Share data via custom URLs, emails, and other techniques Find and fix common Cocoa Touch software bugs, fast Avoid the performance bottlenecks that affect Cocoa Touch code

Introduction 1About This Book 1About You 2About Objective-C 2What You Need 2How to Read This Book 3Conventions Used in This Book 3PART I: Understanding the Objective-C LanguageHOUR 1: Starting Your First Application: A Calculator 5Setting Up Your Development Tools 5Using Xcode 6Using Interface Builder 13Summary 20Workshop 21Exercise 21HOUR 2: Handling Interaction 23Objective-C 23Binding an Object to the User Interface 31Basic Memory Management 39Invoking Methods on nil 41Type Checking Rules 41Type Equivalence 42Type Checking 42Summary 44Q&A 45Workshop 45Exercise 46HOUR 3: Simplifying Your Code 47Managing Memory with NSAutoReleasePools 47Objective-C Strings 52Introducing the Debugger 62Understanding Messaging 65Debugging a Real Bug 68Using Shorthands 70Summary 74Q&A 74Workshop 74Exercises 75HOUR 4: Making the Calculator Calculate 77A Simple Calculator 78Mutable Classes: Making a “Printing” Calculator 82Dynamic Objective-C 88Summary 96Q&A 96Workshop 96Exercises 97HOUR 5: Adding Variables to the Calculator 99A Better Model/Controller Split 99Using an NSDictionary to Add Variables to the Calculator 106The Key-Value Coding and Observing Protocols 113Summary 120Workshop 120Exercise 121PART II: User-Interface FoundationsHOUR 6: Understanding How the User Interface Is Built 123User-Interface Building-Blocks: Views 123Building the UI from Views 136Summary 147Q&A 147Workshop 148Exercise 148HOUR 7: Understanding How Events Are Processed 149Run Loops and Core Foundation 149How Cocoa Uses the Run Loop 155Touch Event Dispatching 160Summary 167Q&A 168Workshop 168Exercises 169HOUR 8: Drawing User-Interface Elements 171Adding Images to UIButton 171Core Graphics 178Drawing Your Own Button 194Summary 199Q&A 199Workshop 199Exercises 200HOUR 9: Layers and Core Animation: Creating a Cover Flow Clone 201Placing Layers in 3D Space 202Using Core Animation 208Creating a Cover Flow Clone 220Summary 230Q&A 230Workshop 231Exercises 231PART III: Advanced User-Interface ElementsHOUR 10: Using View Controllers 233View Controllers 233Adding a Scientific Mode to the Calculator 242Summary 250Q&A 250Workshop 251Exercises 252HOUR 11: Displaying Tables 253Creating Tables 254Using Table Cells 261Creating a Twitter Application 268Summary 272Q&A 273Workshop 273Exercises 274HOUR 12: Adding Navigation and Tab Bar Controllers 275Using Modal View Controllers 275Saving Application Defaults 279Using Tab Bars 283Using Navigation Bars 287Summary 295Q&A 295Workshop 295Exercises 296HOUR 13: Adding Undo and Redo Functionality 297Creating Your Own Undo/Redo Manager 297Using NSUndoManager 305Summary 307Q&A 307Workshop 308Exercise 308PART IV: Accessing the InternetHOUR 14: Accessing the Network 309How Networks Work 309How the Web Works 316Using Cocoa Touch to Access the Web 321Making the Twitter Application Deal with Errors 328Summary 330Q&A 331Workshop 331Exercises 332HOUR 15: Showing a Web Page 335Understanding UIWebView 335Using UIWebViews 339Using WebKit Extensions 345Summary 352Q&A 352Workshop 353Exercises 354PART V: Saving and Retrieving DataHOUR 16: Adding Application Preferences 355Retrieving Settings Set by the Settings Application 356Creating a Settings Bundle for the Settings Application 357Dynamically Updating Data from the Network 365Summary 368Q&A 369Workshop 369Exercises 370HOUR 17: Using the SQLite Database 371Saving and Reading Data from Files 371Saving and Reading Data from an SQLite Database 373Summary 385Q&A 385Workshop 385Exercise 386HOUR 18: Using Core Data 387Using NSSortDescriptor and NSPredicate 387Using Core Data 390Using Xcode to Design Objects 404Summary 407Q&A 407Workshop 407Exercises 408PART VI: Interacting with the WorldHOUR 19: Playing and Recording Media 409Playing and Recording Audio 409Playing Video Files 426Summary 429Q&A 430Workshop 430Exercises 431HOUR 20: Sensing the World 433Using the iPhone’s Accelerometer 433Determining the iPhone’s Location 438Taking Photos and Making Short Videos 444Summary 446Q&A 446Workshop 446Exercises 447HOUR 21: Sharing Data 449Using Custom URLs 449Using Pasteboards 452Exporting Data 455Summary 459Q&A 459Workshop 460Exercises 461PART VII: Completing Your ApplicationHOUR 22: Debugging 463Using gdb, dtrace, valgrind, and nib2objc 463Resolving Cocoa Misunderstandings 472Summary 477Q&A 477Workshop 477Exercise 478HOUR 23: Optimizing Performance 79Profiling Your Code . 479Optimizing Your Memory Usage 486Optimizing Your Code’s Speed 495Summary 500Q&A 500Workshop 501Exercise 502HOUR 24: Shipping Your Application 503Polishing Your Application for Submission 503Localizing Your Application 506Submitting Your Application to the App Store 514Summary 517Q&A 518Workshop 519Exercise 520APPENDIX A: C Primer (Online) 521Functions 521Primitive Types 521Basic Operators 522Function Signatures 522Interface Files 522System Libraries 522Composite Structures 523Memory Access 523Arrays 524Dynamic Memory Allocation 524Strings 524Types 525New Kinds of Errors 525APPENDIX B: Troubleshooting Xcode (Online) 527Logging in to the Developer Website 527Obtaining Permission to Upload Your Application to Your Device 529Building Your Application to Run on a Device 531Updating Mobile Provisions 533Debugging the Ambiguous Matches Error 534Uploading Your Application to Your Device 534Checking Changes That Do Not Show Up 540Checking the App Store Executable 541APPENDIX C: Resources 543This Book’s Website 543Books and Papers 543Web Resources 545APPENDIX D: Advanced Topics (Online) 547Testing String Mutability with Exceptions 547Uncaught Exceptions 547The Implementation of Exceptions. 548NSZones 549Creating Singletons by Overriding allocWithZone: 550Extending Objects by Overriding allocWithZone: 551How Applications Start 552Threads 553pthreads 554NSThreads 555Deciding Whether to Use Threading or One-Shot Invocation 560Types of Layers 562View Controller Hierarchy Used in the Twitter Application 566Index567