Developing C# Apps for iPhone and iPad Using MonoTouch: iOS Apps Development for .NET Developers

Book description

Developing C# Applications for iPhone and iPad using MonoTouch shows you how to use your existing C# skills to write apps for the iPhone and iPad. Fortunately, there's MonoTouch, Novell's .NET library that allows C# developers to write C# code that executes in iOS. Furthermore, MonoTouch allows you to address all the unique functions of the iPhone, iPod Touch, and iPad. And the big plus: You needn't learn any Objective-C to master MonoTouch!

Former Microsoft engineer and published app-store developer Bryan Costanich shows you how to use the tools you already know to create native apps in iOS using C# and the .NET Base Class Libraries. The magic is in Novell's implementation of Apple's Cocoa libraries in MonoTouch. You'll master the same elegant and rich Cocoa environment, but without the need to learn a new programming language.

Developing C# Applications for iPhone and iPad using MonoTouch takes you from your first "Hello, World" example through the major APIs and features of iOS. The coverage is comprehensive and makes use of frequent examples, complete with sample code you can download and reuse to create your own powerful and playful apps.

What you'll learn

  • How to use your existing C# skills to develop applications on the iPhone and iPad

  • Apple's Model View Controller (MVC) methodology

  • Working with CocoaTouch's UIKit to create iOS applications using native controls

  • Device-specific features, like the camera, GPS, and Compass using CoreLocation, the accelerometer, and others

  • Accessing shared resources such as the photos, contacts, and more

  • How to persist and retrieve data using SQLite and .NET libraries

  • Complex drawing and animation using CoreGraphics and CoreAnimation

  • The use of Apple's Push Notification Service

  • The latest game porting techniques using XNA Touch

  • How to integrate off-the-shelf Objective-C libraries

Who this book is for

Every .NET and C# developer who has have ever wanted to create an application or game for Apple's App Store.

Table of contents

  1. Copyright
  2. About the Author
  3. About the Technical Reviewer
  4. Acknowledgments
  5. Preface
  6. 1. Getting Started with MonoTouch
    1. 1.1. Developing for the iPhone and iPad
      1. 1.1.1. Limited Multitasking
      2. 1.1.2. Limited System Resources
      3. 1.1.3. Small Screen Size
      4. 1.1.4. Device-specific Technology
      5. 1.1.5. Constrained Response Time
      6. 1.1.6. Constrained Access
    2. 1.2. MonoTouch Background
      1. 1.2.1. iPhone vs. iPod Touch vs iPad?
      2. 1.2.2. How Does It Work?
      3. 1.2.3. How Do I Build a User-Interface (UI); Can I Use Silverlight?
      4. 1.2.4. How Do I Distribute My Apps?
      5. 1.2.5. What Is the Licensing Model?
      6. 1.2.6. Are There Any Limitations of MonoTouch?
        1. 1.2.6.1. No Just-in-Time (JIT) Compilation
        2. 1.2.6.2. C# Is Currently the Only Language
        3. 1.2.6.3. More Information
    3. 1.3. Getting Started
      1. 1.3.1. Mac Computer Running Snow Leopard
      2. 1.3.2. Apple's iOS SDK
      3. 1.3.3. Mono for OSX
      4. 1.3.4. MonoTouch SDK
      5. 1.3.5. Text Editor or Integrated Development Environment
      6. 1.3.6. Documentation
        1. 1.3.6.1. Xcode/iOS Documentation
        2. 1.3.6.2. MonoTouch Rosetta Stone
      7. 1.3.7. Resources
      8. 1.3.8. 3rd Party Libraries
    4. 1.4. Summary
  7. 2. Our First Application
    1. 2.1. Starting the Example
      1. 2.1.1. Create a New Solution
      2. 2.1.2. Examining the Code
    2. 2.2. Interface Builder
      1. 2.2.1. Exploring Interface Builder
      2. 2.2.2. Building the Interface
    3. 2.3. Outlets
      1. 2.3.1. Outlets Exposed to Code
      2. 2.3.2. Running the Application
    4. 2.4. Actions
      1. 2.4.1. Adding an Action
      2. 2.4.2. Actions in Code
    5. 2.5. Choosing Which Device to Simulate
    6. 2.6. Application Name and Icons
      1. 2.6.1. Application Name
      2. 2.6.2. Application Icons
    7. 2.7. Summary
  8. 3. Creating Multi-Screen Applications Using the MVC Pattern
    1. 3.1. Model-View-Controller (MVC) Pattern
      1. 3.1.1. Model
      2. 3.1.2. View
      3. 3.1.3. Controller
    2. 3.2. Benefits of the MVC Pattern
    3. 3.3. Views and View Controllers in MonoTouch
    4. 3.4. Sample Application
      1. 3.4.1. Adding the Navigation Controller to the Main Screen
      2. 3.4.2. HelloWorld and HelloUniverse Screens
      3. 3.4.3. Showing Different Screens
        1. 3.4.3.1. MainScreen.xib.cs
        2. 3.4.3.2. AppDelegate
    5. 3.5. Summary
  9. 4. iPad and Universal (iPhone/iPad) Applications
    1. 4.1. A Note About Resolution on the iPhone
    2. 4.2. Creating an iPad-Only Application
      1. 4.2.1. Changing Common Settings in MonoDevelop
      2. 4.2.2. iPad Screens in Interface Builder
    3. 4.3. Creating a Universal iPhone/iPad Application
      1. 4.3.1. Method 1: Universal Project Template
      2. 4.3.2. Method 2: Programmatic Device Detection
        1. 4.3.2.1. Determining the Device Type
        2. 4.3.2.2. Creating a Custom AppDelegate
        3. 4.3.2.3. Creating a Custom Main Method
    4. 4.4. Summary
  10. 5. More on Views and Controllers
    1. 5.1. Custom UIViewController and UIView Implementations
      1. 5.1.1. Default UIView Constructor for a View Defined in a xib file
      2. 5.1.2. Manually Loading a UIView Defined in a .xib File
      3. 5.1.3. UIViewController Event Lifecycle
        1. 5.1.3.1. LoadView
        2. 5.1.3.2. ViewDidLoad
        3. 5.1.3.3. ViewDidUnload
        4. 5.1.3.4. ViewWillAppear
        5. 5.1.3.5. ViewWillDisappear
        6. 5.1.3.6. Other Methods
      4. 5.1.4. UIView Event Lifecycle
        1. 5.1.4.1. Constructor
        2. 5.1.4.2. Draw
        3. 5.1.4.3. LayoutSubviews
    2. 5.2. Managing More than One View in a Controller
      1. 5.2.1. Switching Views
      2. 5.2.2. Animating the Transition
    3. 5.3. Handling Rotation
      1. 5.3.1. Rotation Lifecycle Events in UIViewController
        1. 5.3.1.1. ShouldAutorotateToInterfaceOrientation
        2. 5.3.1.2. WillAnimateRotation
        3. 5.3.1.3. WillRotate
        4. 5.3.1.4. DidRotate
        5. 5.3.1.5. WillAnimateFirstHalfOfRotation and WillAnimateSecondHalfOfRotation
      2. 5.3.2. General Approaches to Rotation
        1. 5.3.2.1. Autosizing
        2. 5.3.2.2. Moving Controls
        3. 5.3.2.3. Swapping Views
      3. 5.3.3. Rotation Review
    4. 5.4. Summary
  11. 6. Introduction to Controls
    1. 6.1. Coordinate System
      1. 6.1.1. Frame
    2. 6.2. Autosizing
    3. 6.3. Working with Fonts
      1. 6.3.1. Font Sizes
      2. 6.3.2. Enumerating Fonts
    4. 6.4. Tags
    5. 6.5. Control States
    6. 6.6. Working with Images
      1. 6.6.1. FromFile vs. FromBundle
        1. 6.6.1.1. FromBundle
        2. 6.6.1.2. FromFile
      2. 6.6.2. Which One?
    7. 6.7. Subclassing (Creating Custom Controls)
      1. 6.7.1. Necessary Constructors
      2. 6.7.2. Registering Your Controls
      3. 6.7.3. Using Your Controls in Interface Builder
    8. 6.8. Prototypes vs. Delegates vs. Events, What?
      1. 6.8.1. Protocols
      2. 6.8.2. Delegates
      3. 6.8.3. Weak-Delegates
    9. 6.9. Updating Your Controls from the UI Thread
    10. 6.10. Summary
  12. 7. Standard Controls
    1. 7.1. UILabel
      1. 7.1.1. Text Wrapping Options
        1. 7.1.1.1. Number of Lines
      2. 7.1.2. UITextField
      3. 7.1.3. Borders
      4. 7.1.4. Text Value
      5. 7.1.5. Default Placeholder Text
      6. 7.1.6. Keyboards
    2. 7.2. UIButton
      1. 7.2.1. Handling 'Clicks'
      2. 7.2.2. Different Types of Buttons
      3. 7.2.3. Button Text
    3. 7.3. UIImage
      1. 7.3.1. Animating an Image View
    4. 7.4. UIScrollView
      1. 7.4.1. Zooming
      2. 7.4.2. Implementing Tap-to-Zoom
      3. 7.4.3. Scroll Paging
    5. 7.5. UISegmentedControl
      1. 7.5.1. Configuring the Segmented Control
      2. 7.5.2. Specifying Segment Sizes
      3. 7.5.3. Handling Button Presses
    6. 7.6. UISwitch
    7. 7.7. UISlider
      1. 7.7.1. Images
      2. 7.7.2. Accessing the Value
    8. 7.8. UIActivityIndicatorView
    9. 7.9. UIProgressView
      1. 7.9.1. Setting the Progress Value
    10. 7.10. UIPagerControl
      1. 7.10.1. Page Changes via the Pager Control
      2. 7.10.2. Updating the Pager Control When the Page is Scrolled to Via a Scroll View
    11. 7.11. UIAlertView
      1. 7.11.1. Alerts and Garbage Collection
      2. 7.11.2. Working with Buttons
      3. 7.11.3. Alert Delegate
      4. 7.11.4. Customizing the Alert View Even Further
    12. 7.12. UIActionSheet
      1. 7.12.1. Creating a Simple Action Sheet
      2. 7.12.2. Button Types
      3. 7.12.3. Adding Custom Buttons
      4. 7.12.4. Displaying an Action Sheet
      5. 7.12.5. Subclassing
    13. 7.13. UIDatePicker
      1. 7.13.1. Configuration
      2. 7.13.2. Showing Dynamically
    14. 7.14. UIPickerView
      1. 7.14.1. Populating the Picker
      2. 7.14.2. UIPickerViewModel
    15. 7.15. UIToolbar
      1. 7.15.1. Item Types
      2. 7.15.2. Toolbars in Interface Builder
      3. 7.15.3. Programmatic Creation
      4. 7.15.4. Sizing
      5. 7.15.5. Handling Clicks
    16. 7.16. Summary
  13. 8. Content Controls
    1. 8.1. Navigation Controller
      1. 8.1.1. Parts of the Navigation Controller
      2. 8.1.2. Using the Navigation Controller
      3. 8.1.3. Modifying the Navigation Bar
        1. 8.1.3.1. Title
        2. 8.1.3.2. Style
        3. 8.1.3.3. TintColor
        4. 8.1.3.4. Opacity
        5. 8.1.3.5. Right Button
      4. 8.1.4. Navigation Toolbar
    2. 8.2. Tab Bar Controller
      1. 8.2.1. Creating a Tab Bar Controller
        1. 8.2.1.1. Tab Bar Items
        2. 8.2.1.2. Using a Custom Tab Bar Controller
        3. 8.2.1.3. User Customizable Tabs
        4. 8.2.1.4. Tab Badges
    3. 8.3. Split View Controller
      1. 8.3.1. Using the Split View
        1. 8.3.1.1. Creating Views for the Split View
        2. 8.3.1.2. Showing and Hiding the Button to Show the Master View
        3. 8.3.1.3. Communicating Between the Master and Detail View
    4. 8.4. Web View
      1. 8.4.1. Using the Web View
        1. 8.4.1.1. NSUrl
        2. 8.4.1.2. Navigation
        3. 8.4.1.3. Events
          1. 8.4.1.3.1. LoadStarted
          2. 8.4.1.3.2. LoadingFinished
          3. 8.4.1.3.3. LoadError
      2. 8.4.2. Loading Local Content
      3. 8.4.3. Interacting with Page Content
        1. 8.4.3.1. Running JavaScript
        2. 8.4.3.2. Listening for Events
      4. 8.4.4. Loading Non-Web Documents
    5. 8.5. Map View
      1. 8.5.1. Using the Map View
        1. 8.5.1.1. Different Map Modes
      2. 8.5.2. Using Device Location
      3. 8.5.3. Annotating the Map
        1. 8.5.3.1. GetViewForAnnotation
        2. 8.5.3.2. Annotation Views
        3. 8.5.3.3. MKPinAnnotationView
        4. 8.5.3.4. Handling Annotation Callout Clicks
        5. 8.5.3.5. Annotation Performance Considerations
      4. 8.5.4. User Overlays
        1. 8.5.4.1. Creating the Overlay
        2. 8.5.4.2. Adding the Overlay
        3. 8.5.4.3. Implementing GetViewForOverlay
    6. 8.6. Search Bar
    7. 8.7. Summary
  14. 9. Working with Tables
    1. 9.1. Parts of the UITableView
    2. 9.2. Populating a Table
      1. 9.2.1. UITableViewSource
    3. 9.3. Responding to User Interaction
    4. 9.4. UITableViewController
    5. 9.5. Refreshing the Table When Data Changes
    6. 9.6. Customizing the Appearance of a Table View
      1. 9.6.1. Table Styles
      2. 9.6.2. Providing a Table Index
      3. 9.6.3. Cell Styles
        1. 9.6.3.1. Cell Accessories
        2. 9.6.3.2. Other Cell Customizations
      4. 9.6.4. Custom Cells
        1. 9.6.4.1. Creating a Custom Cell in Interface Builder
        2. 9.6.4.2. Creating a Custom Cell in Code
    7. 9.7. Editable Tables
      1. 9.7.1. Editing Methods
        1. 9.7.1.1. CommitEditingStyle Method
        2. 9.7.1.2. MoveRow Method
      2. 9.7.2. Deleting Items
      3. 9.7.3. Advanced Table Editing
    8. 9.8. Table Performance Considerations
      1. 9.8.1. Cell Reuse
      2. 9.8.2. Cache the Row Height
      3. 9.8.3. Cache Images
      4. 9.8.4. Avoid Transparency
      5. 9.8.5. Manually Draw the Cell
      6. 9.8.6. Avoid Complex Graphical Computations
      7. 9.8.7. Create Your Cell in Code
      8. 9.8.8. Further Optimizations
    9. 9.9. Summary
  15. 10. Working with Keyboards
    1. 10.1. Keyboard/Input Properties
      1. 10.1.1. Capitalization
      2. 10.1.2. Correction
      3. 10.1.3. Keyboard
      4. 10.1.4. Return Key
      5. 10.1.5. Languages
    2. 10.2. Hiding the Keyboard
    3. 10.3. Making Input Fields Visible When the Keyboard Covers Them
    4. 10.4. Summary
  16. 11. Multitasking
    1. 11.1. Application States
    2. 11.2. Understanding Background Tasks
      1. 11.2.1. Checking for Multitasking Capability
      2. 11.2.2. Application Delegate Methods
      3. 11.2.3. Multitasking Guidelines and Requirements
    3. 11.3. Asking the iOS for Time to Complete a Task
      1. 11.3.1. Task Execution Expiration Time
      2. 11.3.2. Task Completion Patterns
    4. 11.4. Registering Your Application to be Allowed to Perform a Particular Background Task Category
    5. 11.5. Audio Applications
    6. 11.6. Location Applications
    7. 11.7. VoIP Applications
      1. 11.7.1. VoIP Socket Handling
      2. 11.7.2. VoIP Keep-alive
    8. 11.8. Summary
  17. 12. Working with Touch
    1. 12.1. When to Use Which?
    2. 12.2. Enabling Touch
    3. 12.3. Touch Events
      1. 12.3.1. The UITouch Class
      2. 12.3.2. Using Touch Events
        1. 12.3.2.1.
          1. 12.3.2.1.1. Multi-Taps
          2. 12.3.2.1.2. Multi-Touch
        2. 12.3.2.2. Determining Touch Location
        3. 12.3.2.3. Example Application
        4. 12.3.2.4. Touch Me Image
        5. 12.3.2.5. Double-Tap Me Image
        6. 12.3.2.6. Drag Me Image
    4. 12.4. Gesture Recognizers
      1. 12.4.1. Using Gesture Recognizers
        1. 12.4.1.1. Creating the Gesture Recognizer
        2. 12.4.1.2. Configuring the Gesture
        3. 12.4.1.3. Configuring the Target
          1. 12.4.1.3.1. Using an Anonymous Delegate or Lambda
          2. 12.4.1.3.2. Using the Selector Pattern
        4. 12.4.1.4. Enabling Gesture Recognition
        5. 12.4.1.5. Adding the Gesture to a View
      2. 12.4.2. Retrieving Gesture Information
        1. 12.4.2.1. Gesture Recognizer States
      3. 12.4.3. Example Using the Tap Gesture
      4. 12.4.4. Example Using the Pan Gesture to Drag an Object
        1. 12.4.4.1. Working with Multiple Gesture Recognizers
          1. 12.4.4.1.1. Allowing Simultaneous Gesture Recognition
          2. 12.4.4.1.2. Disabling Another Gesture
          3. 12.4.4.1.3. Requiring Another Gesture to Fail Before One Succeeds
      5. 12.4.5. Allowing Gestures and Touch Events Simultaneously
      6. 12.4.6. Creating a Custom Gesture
        1. 12.4.6.1. Checkmark Gesture Recognizer Example
        2. 12.4.6.2. Reset Method
        3. 12.4.6.3. Using the Custom Gesture Recognizer
    5. 12.5. Summary
  18. 13. Working with Shared Resources
    1. 13.1. File System
      1. 13.1.1. Case-Sensitivity
      2. 13.1.2. Application Sandbox
      3. 13.1.3. Application Directories
      4. 13.1.4. Backup/Restore
      5. 13.1.5. Application Updates
    2. 13.2. Device Battery
      1. 13.2.1. Battery Level
      2. 13.2.2. Battery State
      3. 13.2.3. Getting Battery Change Notifications
    3. 13.3. Address Book/Contacts
      1. 13.3.1. Address Book Controllers
        1. 13.3.1.1. People Picker View Controller (Contact Picker)
          1. 13.3.1.1.1. Cancelled Event
          2. 13.3.1.1.2. SelectPerson Event
        2. 13.3.1.2. Person View Controller
        3. 13.3.1.3. New Person View Controller
          1. 13.3.1.3.1. NewPersonComplete Event
        4. 13.3.1.4. Unknown Person View Controller
          1. 13.3.1.4.1. PersonCreated Event
      2. 13.3.2. Working Directly with the Address Book
        1. 13.3.2.1. Address Books (ABAddressBook)
          1. 13.3.2.1.1. Change Notifications
        2. 13.3.2.2. Records
        3. 13.3.2.3. Record Properties
    4. 13.4. Photos and Camera
      1. 13.4.1. UIImagePickerController
        1. 13.4.1.1. Determining Support
          1. 13.4.1.1.1. Sources
          2. 13.4.1.1.2. Cameras and Flash
          3. 13.4.1.1.3. Media Types
        2. 13.4.1.2. Creating the Image Picker
        3. 13.4.1.3. Configuring the Image Picker
          1. 13.4.1.3.1. Source
          2. 13.4.1.3.2. Media Types
          3. 13.4.1.3.3. Camera Controls
        4. 13.4.1.4. Providing a Custom Camera Overlay
        5. 13.4.1.5. Displaying the Image Picker
        6. 13.4.1.6. Handling Image Picker Events
        7. 13.4.1.7. Implementing a UIImagePickerControllerDelegate
        8. 13.4.1.8. Canceled Event/Method
        9. 13.4.1.9. FinishedPickingMedia Event/Method
      2. 13.4.2. AV Foundation Framework
        1. 13.4.2.1. Enumerating User Albums
    5. 13.5. Network Activity Indicator
    6. 13.6. Accelerometer
      1. 13.6.1.
        1. 13.6.1.1. Shake Gesture
    7. 13.7. Summary
  19. 14. User and Application Settings
    1. 14.1. Working with Settings in the iOS
    2. 14.2. Registering Settings with the Settings Application
      1. 14.2.1. Creating a Settings Bundle
      2. 14.2.2. Creating the Property List File
        1. 14.2.2.1. Property Specifier Schema
        2. 14.2.2.2. PSGroupSpecifier
        3. 14.2.2.3. PSTextFieldSpecifier
        4. 14.2.2.4. PSTitleValueSpecifier
        5. 14.2.2.5. PSSliderSpecifier
        6. 14.2.2.6. PSToggleSwitchSpecifier
        7. 14.2.2.7. PSMultiValueSpecifier
        8. 14.2.2.8. PSChildPaneSpecifier
    3. 14.3. Accessing Settings
    4. 14.4. Saving Settings
    5. 14.5. Initializing Settings
    6. 14.6. Summary
  20. 15. Working with CoreLocation
    1. 15.1. Under the Hood
    2. 15.2. Usage Pattern
    3. 15.3. Instantiating CLLocationManager
    4. 15.4. Configuring the Location Manager
      1. 15.4.1. Update Threshold
      2. 15.4.2. Accuracy
    5. 15.5. Listening for Updates
      1. 15.5.1. UpdatedLocation
        1. 15.5.1.1. CLLocation
      2. 15.5.2. UpdatedHeading
        1. 15.5.2.1. CLHeading
    6. 15.6. Starting the Location Service Updates
      1. 15.6.1. Capabilities
    7. 15.7. Stopping Updates
    8. 15.8. Battery Drain
    9. 15.9. Summary
  21. 16. Drawing with CoreGraphics
    1. 16.1. Painter's Model
    2. 16.2. Performance
    3. 16.3. Colors
      1. 16.3.1. A Bit o' Color Theory
      2. 16.3.2. Alpha RGB
      3. 16.3.3. UIColor and CGColor
    4. 16.4. Drawing Context
      1. 16.4.1. Drawing Onscreen
      2. 16.4.2. Drawing Off-Screen
        1. 16.4.2.1. CGBitmapContext
        2. 16.4.2.2. CGLayer
    5. 16.5. CoreGraphics Coordinate System
      1. 16.5.1. Transforming the Context Coordinate Space
      2. 16.5.2. Transforming the Coordinates of Individual Drawing Operations
    6. 16.6. Drawing Tools
      1. 16.6.1. Paths
        1. 16.6.1.1. Stroking and Filling Paths
      2. 16.6.2. Primitives
      3. 16.6.3. Text
      4. 16.6.4. Images
      5. 16.6.5. Patterns
        1. 16.6.5.1. Creating a Color Pattern
        2. 16.6.5.2. Creating a Stencil Pattern
      6. 16.6.6. Shadows
        1. 16.6.6.1. Grayscale Shadows
        2. 16.6.6.2. Color Shadows
    7. 16.7. Transformations
      1. 16.7.1.
        1. 16.7.1.1. Translation (Moving)
        2. 16.7.1.2. Scaling
        3. 16.7.1.3. Rotation
        4. 16.7.1.4. Custom Transforms
    8. 16.8. Hit Testing
    9. 16.9. Updating the Drawing Surface in Real-time
      1. 16.9.1. Full View Update
      2. 16.9.2. Partial View Updates
    10. 16.10. Other Features of CoreGraphics
    11. 16.11. Summary
  22. 17. Core Animation
    1. 17.1. View-Based Animation Framework
      1. 17.1.1. View Animations via the Animation Blocks
      2. 17.1.2. View Animations via Block-Based Animation
      3. 17.1.3. Comparison of the Two Approaches
      4. 17.1.4. What Is Animatable?
      5. 17.1.5. Configuring Animation Behavior
        1. 17.1.5.1. Nested Animations
        2. 17.1.5.2. Specifying Behavior via Animate Method Overloads
          1. 17.1.5.2.1. UIViewAnimationOptions Enumeration
      6. 17.1.6. Animation Curves
      7. 17.1.7. View Transitions
      8. 17.1.8. Specifying Behavior via Methods
    2. 17.2. Advanced Core Animation with Layers
      1. 17.2.1. Layer-Based Animation
      2. 17.2.2. Layer Animation Types
        1. 17.2.2.1. Explicit Animations
          1. 17.2.2.1.1. Animation Types
        2. 17.2.2.2. Creating CALayers Manually
        3. 17.2.2.3. Drawing Layers on a View
        4. 17.2.2.4. Implicit Animations
    3. 17.3. Summary
  23. 18. Notifications
    1. 18.1. How Notifications Work
    2. 18.2. Scheduling Local Notifications
    3. 18.3. Handling Notifications
    4. 18.4. Push Notifications
      1. 18.4.1. Restrictions and Limitations
      2. 18.4.2. The Sandbox and Production Environments
      3. 18.4.3. APNS-Sharp
      4. 18.4.4. Identifying Devices
        1. 18.4.4.1. Registering for Remote Notifications and Getting a Device Token
          1. 18.4.4.1.1. Registering to Receive Remote Notifications in iOS
          2. 18.4.4.1.2. Receiving the Token
          3. 18.4.4.1.3. Listening for Registration Failure
        2. 18.4.4.2. Retrieving Expired Tokens with the Feedback Service
      5. 18.4.5. Creating a Push Notification Certificate
      6. 18.4.6. Creating and Installing a Provisioning Profile
      7. 18.4.7. Sending Push Notifications
        1. 18.4.7.1. Converting the Certificate
        2. 18.4.7.2. Sending a Notification
    5. 18.5. Summary
  24. 19. Working with Data
    1. 19.1. SQLite
      1. 19.1.1. Limitations of SQLite
      2. 19.1.2. Version Matrix
      3. 19.1.3. Creating a Database
    2. 19.2. Backups and Data Update Strategy
      1. 19.2.1. Backups
      2. 19.2.2. Application Updates
    3. 19.3. Data Access Technologies
      1. 19.3.1. ADO.NET
        1. 19.3.1.1. Creating a Database
        2. 19.3.1.2. Creating a Schema and Adding Data
        3. 19.3.1.3. Selecting Data
      2. 19.3.2. SQLite-Net
        1. 19.3.2.1. Database Creation
        2. 19.3.2.2. Object Mapping
        3. 19.3.2.3. Table Creation and Data Import
        4. 19.3.2.4. Selecting Data
      3. 19.3.3. Vici CoolStorage
        1. 19.3.3.1. Object Mapping
        2. 19.3.3.2. Creating a Database
        3. 19.3.3.3. Table Creation and Data Import
        4. 19.3.3.4. Query Data
      4. 19.3.4. NHibernate
    4. 19.4. Summary
  25. 20. Publishing to the App Store
    1. 20.1. Review Guideline Conformity
      1. 20.1.1. Apple Blog
    2. 20.2. Building for Distribution
      1. 20.2.1. Creating and Installing a Distribution Provisioning Profile
      2. 20.2.2. Adding a Distribution Build Configuration
      3. 20.2.3. Configure Distribution Bundle Signing
      4. 20.2.4. Building
        1. 20.2.4.1. Having MonoDevelop Build and Zip for You
        2. 20.2.4.2. Manually Building and Zipping
    3. 20.3. Submitting Your App via iTunes Connect
    4. 20.4. Application Rejection Dispute Resolution
    5. 20.5. Summary
  26. 21. Third-Party Libraries
    1. 21.1. MonoTouch.Dialog
      1. 21.1.1. DialogViewController
      2. 21.1.2. RootElement, Sections, and Child Elements
        1. 21.1.2.1. Sections
        2. 21.1.2.2. Elements
      3. 21.1.3. Using MT.D
        1. 21.1.3.1. Creating the Element (Content) Tree Manually
        2. 21.1.3.2. Using the Object Binding Pattern
      4. 21.1.4. LINQ Support
    2. 21.2. MonoTouch-Facebook
    3. 21.3. Three20
    4. 21.4. Tapku
    5. 21.5. MonoTouch-Controls
    6. 21.6. XNATouch
    7. 21.7. Summary
  27. 22. Using Objective-C Libraries and Code
    1. 22.1. btouch
      1. 22.1.1. btouch Process
    2. 22.2. A Quick Objective-C Primer
      1. 22.2.1. Files
      2. 22.2.2. Classes
      3. 22.2.3. Methods/Messages
        1. 22.2.3.1. Instance vs. Static
        2. 22.2.3.2. Invoking Methods
      4. 22.2.4. Properties
      5. 22.2.5. Protocols
        1. 22.2.5.1. Declaring Protocols
    3. 22.3. Compiling the Objective-C Library
      1. 22.3.1. Building the Tapku Library
        1. 22.3.1.1. Specifying the iOS SDK
        2. 22.3.1.2. Compiling
        3. 22.3.1.3. Combining Build Architectures with LIPO
      2. 22.3.2. Creating API Definition File and Helper Code
        1. 22.3.2.1. API Definition File
        2. 22.3.2.2. Additional Code
        3. 22.3.2.3. Wrapping Tapku
          1. 22.3.2.3.1. TKCoverflowCoverView
          2. 22.3.2.3.2. TKCoverflowDataSource
          3. 22.3.2.3.3. TKCoverflowViewDelegate
          4. 22.3.2.3.4. Finishing the TKCoverflowView Binding
        4. 22.3.2.4. Weak Delegate Pattern
        5. 22.3.2.5. Complete Tapku Coverflow Binding
      3. 22.3.3. Running btouch
      4. 22.3.4. Adding the Compiled Objective-C Library
      5. 22.3.5. Referencing the Wrapper DLL
      6. 22.3.6. Configuring the Build
      7. 22.3.7. Using the Library
    4. 22.4. Summary

Product information

  • Title: Developing C# Apps for iPhone and iPad Using MonoTouch: iOS Apps Development for .NET Developers
  • Author(s): Bryan Costanich
  • Release date: June 2011
  • Publisher(s): Apress
  • ISBN: 9781430231745