Book Image

Learning SQLite for iOS

By : Gene Da Rocha
Book Image

Learning SQLite for iOS

By: Gene Da Rocha

Overview of this book

The ability to use SQLite with iOS provides a great opportunity to build amazing apps. Apple's iOS SDK provides native support for SQLite databases. This combination offers the potential to create powerful, data-persistent applications. This book starts with the architecture of SQLite database and introduces you to concepts in SQL . You will find yourself equipped to design your own database system, administer it, and maintain it. Further, you will learn how to operate your SQLite databases smoothly using SQL commands. You will be able to extend the functionality of SQLite by using its vast arsenal of C API calls to build some interesting, exciting, new, and intelligent data-driven applications. Understand how Xcode, HTML5, and Phonegap can be used to build a cross-platform modern app which can benefit from all these technologies - all through creating a complete, customizable application skeleton that you can build on for your own apps.
Table of Contents (15 chapters)
Learning SQLite for iOS
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Error handling


Handling errors is mandatory when writing systems, especially if it is for mobile devices; so, attention to detail and catching issues with code is vital. The SQLITE_BUSY and SQLITE_ERROR functions are used by programmers to notify and trap errors, and store them for a later analysis.

For example, SQL_ERROR is activated when resources such as locks cannot be granted or are not available, whereas the SQL_BUSY covers issues with transactions and related matters. Another function called sqlite3_errcode() will handle any general SQLite error. These methods and functions are the standard way of handling errors with SQLite.