-actionSheet:clickedButtonAtIndex: method, 124
actionSheetStyle property, 123
activityIndicatorViewStyle property, 96
-addTarget:action:forControlEvents: method, 90, 91, 95, 96
-addTarget:selector:forControlEvents: method, 98, 99
-alertView:clickedButtonAtIndex: method, 123
allowableMovement property, 111
alwaysBounceHorizontal property, 103
alwaysBounceVertical property, 103
animationDuration property, 100
animationImages property, 100
animationRepeatCount property, 100
Application design elements, 87
Cocoa Touch controls (see Cocoa Touch controls)
data views
MKMapView, 104
UIDatePickerView, 107
UITableView, 104
UIWebView, 104
gesture recognizers (see Gesture recognizers)
temporary user interface elements
view controllers (see View controllers)
Automatic Reference Counting (ARC), 20
autocomplete, 25
class documentation, 26
configuring behaviors, 27
file opening, assistant editor, 27
header and implementation files, 26
project conversion, 21
LLVM 3.0 compiler verification, 24
target selection, 22
quick indent/unindent, 26
rules, 21
+availableMediaTypesForSourceType: method, 213
AVAudioRecorder
-pause method, 252
-playPressed: method, 249, 252
-prepareToRecord action, 250
recordPressed: method, 249
-tempFileURL, 250
user interface, 249
AV Foundation, 222
AVCaptureAudioDataOutput, 224
AVCaptureMovieFileOutput, 224
AVCaptureStillImageOutput, 224
AVCaptureVideoDataOutput, 225
AVCaptureVideoDataOutputSampleBufferDelegate protocol, 225
AV framework and capture sessions
Assistant Editor, 222
AVCaptureDeviceInput, 224
AVCaptureVideoDataOutput, 224
AVCaptureVideoPreviewLayer, 224–228
AVMediaTypeAudio, 223
AVMediaTypeVideo, 223
configured outlet and action, 223
CustomCamera, 221
frameworks addition, 222
startButton, 222
UIButton, 222
UIImagePickerController interface, 221
UIVideoEditorController interface, 221
-viewDidLoad method, 223
XIB/header file, 223
-buttonPressed: method, 90
Camera recipes, 205
AV framework and capture sessions
Assistant Editor, 222
AVCaptureDeviceInput, 224
AVCaptureVideoDataOutput, 224
AVCaptureVideoPreviewLayer, 224–228
AVMediaTypeAudio, 223
AVMediaTypeVideo, 223
configured outlet and action, 223
CustomCamera, 221
frameworks addition, 222
startButton, 222
UIButton, 222
UIImagePickerController interface, 221
UIVideoEditorController interface, 221
-viewDidLoad method, 223
XIB/header file, 223
capturing video frames
AVAssetImageGenerator, 237
AVCaptureOutput, 233
AVCaptureSession, 233
AVCaptureStillImageOutput, 233, 234
-captureOutput:didFinishRecordingToOutputFileAtURL:fromConnections:error:method, 237–238
imageGenerator, 237
imageViewThumb and imageViewThumb2, 233
recording application, 239
recordPressed: method, 236
thumbnails, 234
UIImageViews, 233
custom camera overlays, 221
-cameraButtonPressed: method, 219, 220
cornerRadius, 219
currentPicker's value, 219
customView, 218
header file, 219
imagePicker, 219
QuartzCore interface, 218
-toggleFlash:and -toggleCamera:methods, 219–220
UIImagePicker, 218
UIView, 218
editing videos
editButton, 215
NSString property, 215
recording video, 217
UIImagePickerController, 214–215
UINavigationControllerDelegate protocol, 216
UIVideoEditorController, 214, 216–217
UIVideoEditorControllerDelegate protocol, 216
programmatically recording video
Assets Library, 228
AV Foundation, 228
AVCaptureDevice, 229
AVCaptureDeviceInputs, 229
AVCaptureFileOutputRecording Delegate protocol, 229
AVCaptureMovieFileOutput, 229, 232–233
AVCaptureSession, 229
AVCaptureVideoPreviewLayer, 230
CustomVideo, 228
header file, 229
recordPressed, 228
tempFileURL, 232
UIButton, 228
viewDidUnload method, 229
-viewWillAppear: and -viewWillDisappear:, 233
taking pictures
allowsEditing property, 212
Assistant Editor mode, 207–208
cameraButton, 208
-cameraButtonPressed: method, 208, 209
CaptureViewController.m file, 208
CaptureViewController.xib, 207
Chapter6Recipe1, 206
connected outlets and actions, 208
contentMode, 212
-imagePickerController:didFinishPickingMediaWithInfo: method, 211, 212
imageViewRecent, 208
NSDictionary, 211
photo set as background, 213
project settings, 206
single view application template, 205, 206
UIImagePickerController class, 209–212
-cameraButtonPressed: method, 213
CFStringRef, 214
CGPointZero value, 110
CGSizeMake() function, 88
Chapter4HeadingTrackingViewController.xib file, 142
Chapter4RegionMonitoringViewController.m, 154
Cocoa Touch controls
UIActivityIndicatorView, 96–97
UILabel
CGSizeMake() function, 88
dim/undim labels, 88
font, 88
fundamental controls, 87
heavily shadowed text, 88
highlightedTextColor property, 89
one square point shadow, 89
-setText: method, 88
shadowOffset property, 88
textAlignment, 88
textColor, 88
userInteractionEnabled, 89
UIProgressView, 97
UISegmentedControl class, 90–91
UISlider, 95
UISwitch, 96
UITextField
app with enabled functionality, 94
configuration, 93
Interface Builder, 92
notifications, 92
UITextView addition, XIB interface, 92
-viewDidLoad method, 91
XIBfile, 91
contentInsetandcontentOffset, 103
contentMode property, 100
Core data
data model creation
Automatic Reference Counting box, 393–394
editor style, 397
instrument entity, 395, 400–401
MusicSchool, 393
MusicSchool.xcdatamodeld, 395
NSManagedObjectContext, 399
teacher entity, 394–395, 398–399
definition, 391
editor style, 397
file management system, 373
NSFetchedResultsController, 393
NSManagedObjectContext, 392
NSManagedObjectModel, 392
NSManagedObjects
-add method, 410
adding and deleting data, 412–413
-application:didFinishLaunchingWithOptions method, 407
delegate, 418
fetch requests filtering, 419–422
-fetchedObjects, 404
MainTableViewController, 402, 407, 417–418
MainViewController's -viewDidLoad method, 408
MusicSchool.xcdatamodeld file, 413–414
NSFetchedResultsController, 404, 405
NSManagedObject, 404
NSManagedObjectContext, 409
setEditing:animated:method, 412
-tableView:cellForRowAtIndex Path method, 415–417
temporary data, 409
UINavigationController, 406
UITableViewDelegate and UITableViewDataSource protocols, 403
viewDidLoad method, 406
NSManagedObjectsNSEntityDescription, 403
NSPersistentStoreCoordinator, 392
NSString/NSArray, 391
storing data, 391
versioning
attributes, 423
definition, 422
if statement, 426
instrument subclass files, 427
MusicSchool2, 422
new model file set, 425
NSDictionary, 426
NSManagedObject subclass, 427
NSString, 423
persistentStoreCoordinator method, 425
xcdatamodeld, 424
Core Graphics, 222
Core Media, 222
Core motion
accessCMDeviceMotion, 442
-applicationDidEnterBackground method, 441, 444
CMAttitude, 443
CMMotionManager, 438
data access
CMMotionManager, 435
framework, 434
-toggleUpdates method, 439–440, 443–444
XIB setup, 436
gravity Represents, 443
gyroscope, 437
hardware, 438
magneticField, 443
magnetometer, 437
raw device information, 442
registering shake events
MainWindow, 431
measurements, 429
-motionEndedwithEvent method, 432
NSNotificationCenter, 432
shake gesture, 433
shakeDetected, 433
shaking, 433
single view application, 430
-viewDidLoad method, 433
rollLabel, pitchLabel, and yawLabel, 445
rotationRate, 443
-shakeDetected method, 440
-startDeviceMotionUpdates, 443
startDeviceMotionUpdatesToQueue withHandler, 443
startDeviceMotionUpdatesUsingReferenceFrame, 443
userAcceleration Represents, 443
-viewDidUnload method, 441
Core Video, 222
CoreGraphics.framework library, 110
Data storage
core data,file management system, 373
iCloud
12345ABCDE.com.domainName.iCloudTest, 378
App ID, 375
com.domainName.iCloudTest, 378
Documents & Data, 384
Enable Entitlements, 375
iCloudStoreViewController.m file, 378
iCloudStoreViewController.xib file, 380
iOS 5.0, 374
metadataQueryDidFinishGathering, 383
MyDocument.h file, 379
NSFileManager and NSMetadataQuery classes, 382
NSMetadataQuery, 384
project configuration, 374
Provisioning Profiles section, 378
storing key-value data, 386
text saved and loaded, 386
UIDocument: -contentsForType:error: and-loadFromContents:ofType: error:, 380UIDocument abstract class, 379
UITextView, 381
managing files
core data, 373
-encodeWithCoder method, 370
file management system, 360
Hotspot property, 362
Hotspot.h, 360
Hotspot.m, 360
HotspotInfoViewController.h file, 363
HotspotInfoViewController.xib, 362–363
HotspotsInfoDelegate protocol, 365
initWithCoder method, 371
iOS's file management system, 359
-loadData method, 372
newHotspot, 366
NSArray, 372
NSDictionary, 370
NSFileManager, 371
NSMutableArray, 365
NSObject subclass, 360
-populateWithHotspotmethod, 364
saveButtonPressed, 364
-saveData method, 372
Single View Application template, 360
UIApplication, 369
UINavigationController, 366
UITableViewCellEditingStyle, 373
UITableViewDelegate and UITableViewDataSource protocols, 365
<UITextFieldDelegate>, 363
UITextField element, 362
UIViewController subclass, 361
viewDidLoad method, 363
XIB for user interface, 361
NSUserDefaults, 357
Boolean values, 353
iOS simulator, 358
persisting, 358
+resetStandardUserDefaults, 356
+standardUserDefaults method, 356
Stubborn, 353
synchronize method, 356
UISwitch, 357
UITextFieldDelegate protocol methods, 355, 356
view controller's XIB, 354, 355
viewDidUnload method, 355
Xcode, 358
Data transmission recipes, 453
attachment parameter, 461
data to mail attachament, 461–467
fileName parameter, 461
formatted printing, with page renderers, 478
drawPageAtIndex:inRect: method, 479–480
drawPrintFormatter:forPageAtIndex: method, 480
NSString properties, 478
printCustomPressed action, 481–483
UIPrintPageRenderer class, 478
getImagePressed method, 463
image printing, 467
printer simulator application, 471–473
UINavigationController, 467
UIPrintInfoOutputGeneral, 469
UIPrintInfoOutputGrayscale, 468
UIPrintInfoOutputPhoto, 468
UIPrintInteractionController, 469–470
mailPressed method, 459, 465–466
MFMailComposeViewController, 457–458, 461
MFMailComposeViewController's delegate method, 466–467
mimeType parameter, 461
plain text printing, 473
printFormatter property, 474–475
text messaging, 453
configuration, 455
description, 453
MFMessageComposeViewController, 457–458
single view application, 454
textPressed method, 457
UITextView's delegate methods, 457
UIImagePickerControllerDelegate protocol methods, 463–465
dataDetectorTypes, 101
datePickerMode property, 107
defersCurrentPageDisplay property, 98
directionalLockEnabled property, 103
-dismissModalViewController Animated:method, 121
-dismissWithClickedButton Index:animated: method, 123, 124
-flashScrollIndicators method, 104
Game achievements, 569
GKAchievementsViewController, 574–575
iTunes connect setup
Game Center management, 569
new achievement addition, 570
Game Center, 555
achievements (see Game achievements)
checking for, 561
iTunes connect setup
App ID configuration, 556
application information, 556
Leaderboards (see Leaderboards)
player authentication, 561–563
project setup
Build Phases tab, 558
Game Kit framework, 559
iTunes connect, 560
Gesture recognizers
-addGestureRecognizer: method, 108
+isKindOfClass method, 108
-locationInView: method, 109
-locationOfTouch:inView: method, 109
UIGestureRecognizerDelegate protocol, 109
UIGestureRecognizerStateBegan, 108
UIGestureRecognizerStateCancelled, 108
UIGestureRecognizerStateChanged, 108
UIGestureRecognizerStateEnded, 108
UIGestureRecognizerStatePossible, 108
UIGestureRecognizerStateRecognized, 108
UILongPressGestureRecognizer, 110–111
UIPanGestureRecognizer, 110
UIPinchGestureRecognizer, 111
UIRotationGestureRecognizer, 111
UISwipeGestureRecognizer, 109–110
UITapGestureRecognizer, 108, 109
userInteractionEnabled property, 108
handleGesture method, 109, 110
hidesForSinglePage property, 98
hidesWhenStopped property, 96
highlightedAnimationImages property, 100
highlightedImage properties, 99
highlightedTextColor property, 89
horizontalAccuracy property, 133
(IBAction)regionMonitoringToggle:(id)sender method, 154
iCloud
12345ABCDE.com.domainName.iCloudTest, 378
App ID, 375
com.domainName.iCloudTest, 378
Documents & Data, 384
Enable Entitlements, 375
iCloudStoreViewController.m file, 378
iCloudStoreViewController.xib file, 380
iOS 5.0, 374
metadataQueryDidFinishGathering, 383
MyDocument.h file, 379
NSFileManager and NSMetadataQuery classes, 382
NSMetadataQuery, 384
project configuration, 374
Provisioning Profiles section, 378
storing key-value data, 386
text saved and loaded, 386
UIDocument: -contentsForType:error: and -loadFromContents:ofType:error:UIDocument abstract class, 379
UITextView, 381
Image feature detection
-findFacePressed method, 551–552
Single View Application template, 548
view controller's XIB setup, 550
-viewDidLoad method, 551
+imageNamed:method, 99
Image recipes
filters
CIImage creation, 539
CoreImage.framework library, 537
image rotation, 543
NSMutableArray property, 538
populateImagesWithImage, 539, 544
-setMainImage, 538
-tableView:didSelectRowAt
IndexPath:, 540
-tableView:cellForRowAtIndex
Path:, 541
UIImagePickerControllerDelegate protocol, 542
programming screenshots, 520–522
scaling images (seeScaling images)
simple shapes
QuartzCore and CoreGraphics.framework, 516–518
rectangle and ellipse, 519
single view application, 515–516
UIImageViews (see UIImageViews)
imageForSegmentAtIndex: method, 91
imageFromSampleBuffer, 226
-imagePickerController:did FinishPickingMediaWithInfo:delegate method, 219
-initWithContentViewController: initializer, 119
initWithCoordinate method, 175
-initWithItems: method, 91
inputAccessoryView, 102
inputViewproperty, 102
-insertSegmentWithImage: atIndex:animated: method, 91
insertSegmentWithTitle:atIndex:animated: method, 91
Interface Builder
Assistant Editor, 30
inspector pane, 30
navigator pane, 29
outlet connection
action creation and configuration, 33
labelHelloWorld updation, 34
outlet creation, 32
placeholders, 34
storyboards (see Storyboards)
Tint control, 42
touch gesture recognizers, 36
adjusting attributes, 39
attributes inspector, 38
gesture recognizer addition, 36
outline view, 38
placeholders, 40
tapTheLabel action, 41
iPod library
+applicationMusicPlayer, 254
buttons, 253
elements, 253
+iPodMusicPlayer, 254
MPMediaItemCollection, 253
MPMediaPickerController's delegate methods, 256
MPMusicPlayerController, 253
MusicPick, 252
player's queue, 257
-setNotifications method, 254–256
-updateQueueWithMediaItem Collection, 256–257
user interface, 252
-viewDidLoad method, 254
-viewDidUnload method, 258–259
kCLLocationAccuracyHundredMeters, 160
kUTTypeMovie, 214
Leaderboards
high scores, 568
iTunes setup
configuration, 566
Game Center management, 561–563
language display settings, 566
setup, 564
type selection, 565
Local Git repository, Xcode 4
commit message, 13
creation, 9
disabled version control, 13
file changes, 12
filtered modified files, 12
modified and added project files, 10
Location recipes, 125
CLGeocoder object, 162
CLLocationManager object, 127
completionHandler, 162
Core Location framework, 125
device location information, 136
- locationManager:didUpdateTo Location:fromLocation: method, 132
application without location data, 135
Chapter4SampleProject, 127
Chapter4SampleProjectViewController interface file (.h), 130
CLLocation object, 133
CLLocationManager object, 131–132
CLLocationManagerDelegate, 130
Core Location framework addition, 127, 128
description property, 133
desiredAccuracy property, 131
distanceFilter property, 131
Interface Builder, 128
interface file, 130
kCLDistanceFilterNone property, 131
location permissions request, 134
newLocation.description value, 133
NSString, 133
startUpdatingLocation method, 131
stopUpdatingLocation method, 131, 132
toggleLocationServices:sender: action, 130
Xcode 4, 127
location services requirements, 126
magnetic bearing
_locationManager, 144
Chapter4HeadingTracking, 141
Chapter4HeadingTrackingView Controller, 143–144
CLLocationManager object, 141
CLLocationManagerDelegate protocol, 143
delegate methods, 145
didFailWithError method, 145
didUpdateHeading method, 145
heading calibration screen, 146
heading tracking services, 144–145
headingAccuracy property, 145
headingFilter property, 144, 145
headingOrientation property, 141
headingSwitch, 144
labelHeading, 145
locationManagerShouldDisplayHeadingCalibration, 146
magnetic poles, 141
magneticHeading, 145
purpose property, 144
startUpdatingHeading, 144
switchHeadingService method, 143, 144
NSArray placemarks, 162
region monitoring
Chapter4RegionMonitoring, 151
Chapter4RegionMonitoringViewController.xib, 151
CLLocationManager object, 151
CLLocationManagerDelegate protocol, 153
custom coordinates, 156
delegate methods, 155
did enter and did exit, 156
identifier property, 155
implementation file (.m), 154
kCLErrorRegionMonitoringDenied, 155–156
kCLErrorRegionMonitoringFailure error, 151, 155–156
locationManager:monitoringDidFailForRegion:withError: delegate method, 151
maximumRegionMonitoringDistance property, 154
monitoredRegions property, 151, 155
startMonitoringForRegion:desiredAccuracy: method, 151
toggling action, 153
reverse and forward geocoding
action's creation, 159
actionWhereAmI method, 158, 160
Chapter4Geocoder, 157
Chapter4GeocoderViewController implementation file (.m), 160
Chapter4GeocoderViewController interface file (.h), 159–160
Chapter4GeocoderViewController.xib file, 157
CLGeocoder, 157
CLPlacemarks, 161
didFailWithError method, 160
didUpdateToLocation delegate method, 160
didUpdateToLocation method, 161
distanceFilter property, 160
GPS coordinates, 156
labelGeocodeInfo, 158
latitude and longitude coordinates, 156
newLocation timestamp property, 160
NSArray, 161
NSError, 161
placemarks, 161
UISwitch, 159
significant location changes, 126, 127
(IBAction)toggleLocationServices:(id)sender method, 138
application:didReceiveLocalNotification: method, 140
Chapter4SignificantLocationTracker, 136
desiredAccuracy property, 139
distanceFilter property, 139
implementation file (.m), 138
Info.plist, 136
interface file (.h), 138
labelLocation, 138
newLocation, 140
purpose property, 139
required background mode, 136, 137
self.labelLocation.text = newLocation.description;, 140
startMonitoringSignificantLocationChanges method, 139–140
toggleLocationServices, 138
toggling action, 138
UIAlertView, 138
UIBackgroundModes, 136
UILabel, 138
UILocalNotification, 140
standard location service, 126–127
supported devices, 125
true bearing
Chapter4HeadingTrackingViewController.xib file, 147
CLHeading object, 147
declination, 146
didUpdateHeading method, 149
implementation file (.m), 149–150
interface file (.h), 148
labelTrueHeading, 147
startUpdatingLocation method, 147, 148
stopUpdatingLocation, 148
switchHeadingServices method, 148–149
trueHeading property, 147
user interface with label, 147
Map Kit recipes, 163
annotations grouping, location, 199
abs function, 198
-cleanPlaces method, 200
CLLocationDegrees, 194
delegate method, 198
fabs function, 198
-group: method, 198
header file, 193
HotspotMap, 193
hotspots, 195
implementation file, 200
initialization method, 194
-initWithCoordinate: method, 200
map with far too many annotations, 197
-mapView: regionDidChangeAnimated: method, 198, 202
.m file, 194
MKAnnotation protocol, 193
MKMapView, 194
MKPinAnnotationView, 201
NSArrays, 195
.NSMutableArray property, 199
NSObject subclass, 193
placesproperty, 194
-placesCount method, 200
view controller's .m file, 197–198
-viewDidUnload method, 196
viewForAnnotationmethod, 196, 201–202
viewForAnnotation: method, 199
-(void)group(NSArray *)hotspots, 198
with number-specific colors, 203
custom annotations
application, 184
canShowCallout property, 184
centerOffset property, 182
CGPoint value, 182
CGPointMake() function, 182
coordinate, title, and subtitle properties, 180
"Copy items into destination group's folder (if needed)", 178, 179
CustomAnnotationView class, 181–182
CustomAnnotationView.m file, 184–185
DetailViewController .xib, 187, 188
header file, 180
#import "DetailViewController.h", 189
initWithAnnotation:reuseIdentifier:method, 182
leftCalloutAccessoryView, 184, 185
-mapView:annotationView: calloutAccessoryControlTapped: method, 186
MKAnnotationView class, 178, 182
MKAnnotationView subclass, 181
MKPinAnnotationView objects, 177, 183
MyAnnotation.h and CustomAnnotationView.h files, 183
MyAnnotation.m file, 181
NSObject subclass, 180
Objective-C class, 179
titleLabel and subtitleLabel properties, 188
UIImage, 182
UIImageView, 185
UIViewController subclass, 186
viewDidLoadmethod, 178, 183, 189
map with device's location
application with panning and user tracking, 173
BarButtonItem, 171
+ button, framework addition, 165
configuration settings, 164
Core Location and Map Kit frameworks selection, 165
initWithMapView: method, 171
labelUserLocation, 167
location access, 171
MapKit/MapKit.h framework library, 167
-mapView:didUpdateUserLocation: delegate method, 170
MKCoordinateRegionMakeWithDistance method, 168
MKMapView outlet, 167
MKUserLocationFollowWithHeading, 173
MKUserTrackingBarButtonItem, 171, 172
MKUserTrackingModeFollow, 169
SBViewController interface file (.h), 166, 167
SBViewController.h file, 167
self.mapViewUserMap, 170
setUserTrackingMode:animated: method, 169
Single View Application template, 163, 164
toolbarMapTools, 171
userLocationVisible property, 169
.userTrackingMode property, 169
viewDidLoad method, 168, 171, 172
viewDidUnload method, 170
.xib file with MKMapView and UILabel, 165–166
.zoomEnabled and .scrollEnabled properties, 168
marking locations with pins
annotations addition, 176
annotation's coordinate property, 177
application with map and pins, 177
canShowCallout property, 176
rightCalloutAccessoryView property, 176
-viewForAnnotation: delegate method, 177
-mapView:viewForAnnotation: method, 175
maximumNumberOfTouches property, 110
maximumZoomScaleand/or minimumZoomScale properties, 104
mediaType, 214
minimumNumberOfTouches property, 110
minimumPressDuration, 111
MKMapViewDelegate protocol, 167, 178
MKUserTrackingBarButtonItem, 171
MKUserTrackingModeFollow, 169
MKUserTrackingModeFollowWithHeading, 169
MKUserTrackingModeNone, 169
modalPresentationStyle property, 121
modalTransitionStyle property, 121
Multimedia
-addObserver, 270
application category, 265
audio toolbox, 243
AudioServicesPlaySystemSound(), 248
AV foundation, 243
AVAudioPlayer delegate methods, 248
AVAudioPlayerDelegate protocol, 245
AVAudioRecorder
-pause method, 252
-playPressed: method, 249, 252
-prepareToRecord action, 250
recordPressed: method, 249
-tempFileURL, 250
user interface, 249
-canBecomeFirstResponder, 270
CMTimeMake() function, 273
currentIndex, 268
+defaultCenter, 269
enableRate property, 247
frameworks' header files import, 243
iPod library (see iPod library)
-libraryPressed: method, 273–274
MPMediaPropertyPredicates
comparisonType property, 262
MPMediaQuery, 262
NSArray, 270
NSMutableArray, 267
NSNotificationCenter, 270
NSUInteger argument, 247
playButton, 267
-playerItemDidReachEnd, 270
playlist, 267
-playPressed: and -nextPressed: methods, 271
querying media
MPMediaItemProperties, 261
textFieldArtist, 260
UIButton, 259
UITextField, 259
user interface, 260
-viewDidLoad, 260
-queryPressed: method, 260, 261, 274
-remoteControlReceivedWithEvent, 269
required background modes, 265
single view application template, 241, 242
sound clip, 245
UISliders, 247
updateLabels method, 247
-updateNowPlaying, 271
view controller's XIB file, 243, 244
viewDidUnload method, 245
-viewWillDisappear:animated: methods
-numberOfComponentsInPickerView: method, 105
numberOfSegments property, 91
numberOfTapsRequired property, 109, 111
numberOfTouchesRequired property, 109–111
NSManagedObjects
-add method, 410
adding and deleting data, 412–413
-application:didFinishLaunching WithOptions method, 407
delegate, 418
fetch requests filtering, 419–422
-fetchedObjects, 404
MainTableViewController, 402, 407, 417–418
MainViewController's -viewDidLoad method, 408
MusicSchool.xcdatamodeld file, 413–414
NSFetchedResultsController, 404, 405
NSManagedObject, 404
NSManagedObjectContext, 409
setEditing:animated:method, 412
-tableView:cellForRowAtIndexPath method, 415–417
temporary data, 409
UINavigationController, 406
UITableViewDelegate and UITableViewDataSource protocols, 403
viewDidLoad method, 406
NSUserDefaults, 357
Boolean values, 353
iOS simulator, 358
persisting, 358
+resetStandardUserDefaults, 356
+standardUserDefaults method, 356
Stubborn, 353
synchronize method, 356
UISwitch, 357
UITextFieldDelegate protocol methods, 355, 356
view controller's XIB, 354, 355
viewDidUnload method, 355
Xcode, 358
pagingEnabled property, 103
pickerView:didSelectRow:inComponent: method, 105
-pickerView:numberOfRowsIn Component: method, 105
pickerView:rowHeightForComponent: method, 105
pickerView:titleForRow:forComponent: method, 105
pickerView:viewForRow:forComponent:reusingView: method, 105
pickerView:widthForComponent: method, 105
-presentModalViewController:animated: method, 121
-presentPopoverFromBarButtonItem:permittedArrowDirections:animated: method, 119
-presentPopoverFromRect:inView:permittedArrowDirections:animated: method, 119
Printing
progressViewStyle property, 97
-removeAllSegments: method, 91
-removeSegmentAtIndex:animated: method, 91
Required device capabilities, 126
-resignFirstResponder method, 94, 102
Scaling images
configuration, 529
detail view controller, 529
advantages and issues, 536–537
imagePickerController, 530
scrollEnabled property, 103
-scrollRectToVisible:animated: method, 103
scrollsToTop property, 103
-selectedRowInComponent:method, 106
selectedSegmentIndex, 91
-setBackgroundImage:forState:andsetImage:forState: methods, 90
-setContentOffset:animated: method, 103
-setContentViewController:animated: method, 119
-setDate:animated: method, 107
-setImage:forSegmentAtIndex: method, 91
-setOn:animated: method, 96
-setPopoverContentSize:animated: method, 119
-setProgress:animated: method, 97
setTitle:forSegmentAtIndex: method, 91
-setTitle:forState: property, 89
-setValue:animated: method, 95
shadowColorandshadowOffsetproperties, 88
Shake gesture, 433
showsSelectionIndicator property, 106
-sizeForNumberOfPages: method, 98
-startAnimating method, 96
-stopAnimating method, 96
Storyboards
aboutUsViewController view, 48
aboutUsViewController implementation, 85
Back button, 84
configuration, 46
controllers interface, 80
UIButton action, 81
Contact Info view, 53
customized cells, 56
duplicating cells, 56
file copying, 82
file loading, 47
grouped cells, 56
loaded storyboard, 84
Main storyboard file base name, 46
performSegueWithIdentifier, 51
project configuration, 79
ProjectViewController, 83
renaming, 82
scenes, 43
segue identifier settings, 53
Segues, 45
single view application selection, 78
static cells configuration, 55
subgroup addition, 80
target settings, 47
UINavigationBar, 52
UITableView, 57
UITableViewCell prototypes, 72
AppUITableViewCellClass addition, 76, 77
cell identifier, 75
configuring cells, 75
dynamic prototype reselection, 74
MyAppClass, 77
new table view, 74
outlet connection, 75
segue reconfiguration, 75
subclass, 73
UILabel and UIimage outlet property, 73
UITableViewController, 54
UIViewController, 50
-stringValue, 281
tableView: cellForRowAtIndexPath: method, 326
TableView cells, 175
tapGesture, 108
textField:shouldChangeCharactersInRange:replacementString: method, 93
-textFieldDidBeginEditing: method, 93
-textFieldDidEndEditing: method, 93
-textFieldShouldBeginEditing: method, 93
-textFieldShouldEndEditing: method, 93
-textFieldShouldReturn: method, 94
-textView:shouldChangeTextInRange:replacementText: method, 102
-titleColorForState: method, 90
titleForSegmentAtIndex: method, 91
-titleShadowColorForState: method, 90
Touch gesture recognizers, 36
adjusting attributes, 39
attributes inspector, 38
gesture recognizer addition, 36
outline view, 38
placeholders, 40
tapTheLabel action, 41
-translationInView: method, 110
Tweets
composing, 485
description, 485
simpleTweetPressed method, 488–490
Twitter.framework, 487
TWTweetComposeViewController, 491
retrieving, 494
IBAction methods, 497
public timeline data, 502
tabbed application template, 494–496
UITableView, 505
Twitter recipes, 485
description, 485
retrieving tweets, 494
IBAction methods, 497
public timeline data, 502
tabbed application template, 494–496
UITableView, 505
tweets composing, 485
description, 485
simpleTweetPressed method, 488–490
Twitter.framework, 487
TWTweetComposeViewController, 491
TWRequests creation, 491
description, 491
postTweetPressed method, 492–493
UIActionSheetDelegate protocol, 124
UIActionSheetStyleAutomatic value, 123
UIActionSheetStyleBlackOpaque value, 123
UIActionSheetStyleBlackTranslucent value, 123
UIActionSheetStyleDefault value, 123
UIActivityIndicatorView, 97
UIActivityIndicatorViewStyleGray, 96
UIActivityIndicatorViewStyleWhite, 96
UIActivityIndicatorViewStyleWhiteLarge, 96
UIAlertViewDelegate protocol, 123
UIAlertViewStyleDefault, 122
UIAlertViewStyleLoginAndPasswordIn put, 122
UIAlertViewStylePlainTextInput, 122
UIAlertViewStyleSecureTextInput, 122
UIBarButtonItem class, 171
UIButtonTypeContactAdd, 89
UIButtonTypeCustom, 89
UIButtonTypeDetailDisclosure, 89
UIButtonTypeInfoDark, 89
UIButtonTypeInfoLight, 89
UIButtonTypeRoundedRect, 89
UIControlEventValueChanged, 99
UIControlEventValueChanged events, 107
UIControlState, 89
UIDatePickerModeCountDownTimer, 107
UIDatePickerModeDate, 107
UIDatePickerModeDateAndTime, 107
UIDatePickerModeTime, 107
UIGestureRecognizerDelegate protocol, 109
UIGestureRecognizerStateBegan state, 111
UIGestureRecognizerStateChanged state, 110
UIGestureRecognizerStateEnded state, 109, 110
UIImagePickerControllerPhotoLibrary, 209
UIImagePickerControllerSavedPhotosAlbum, 209
UIImagePickerControllerSourceTypeCamera, 209
UIImageViews, 522
clearImagePressed, 528
IOS simulator, 528
project setting configuration, 523
simulated application, 524–525
UIImagePickerControllerDelegate protocol, 527
UIPopoverController, 526
UISplitViewController, 523–524
UIKeyboardDidHideNotification, 92
UIKeyboardDidShowNotification, 92
UIKeyboardWillHideNotification, 92
UIKeyboardWillShowNotification, 92
UILabel
CGSizeMake() function, 88
dim/undim labels, 88
font, 88
fundamental controls, 87
heavily shadowed text, 88
highlightedTextColorproperty, 89
one square point shadow, 89
-setText: method, 88
shadowOffset property, 88
textAlignment, 88
textColor, 88
userInteractionEnabled, 89
UIModalPresentationCurrentContext, 121
UIModalPresentationFormSheet, 121
UIModalPresentationFullScreen, 121
UIModalPresentationPageSheet, 121
UIModalTransitionStyleCoverVertical, 121
UIModalTransitionStyleCrossDissolve, 121
UIModalTransitionStyleFlipHorizontal, 121
UIModalTransitionStylePartialCurl, 121
UIModalTransitionStylePartialCurltransition style, 121
UIModalTransitionStylePartialCurlstyle, 121
UINavigationController
back button, 113
configuration, 113
-initWithRootViewController:, 112
-pushViewController:animated: method, 112
right bar item(s), 114
root view controller, 112
-setToolbarHidden:animated: method, 114
-setToolbarItems: method, 114
title, 113
UINavigationControllerDelegate protocol, 114
-viewDidLoad methods, 114
-viewWillAppear:animated: method, 114
viewWillDisappear:animated: method, 114
UIPageViewController, 120
UIPickerViewDataSource protocol, 105
UIPickerViewDelegate protocol, 105
UIProgressView, 97
UIProgressViewStyleBar:Style, 97
UIProgressViewStyleDefault:Standard style, 97
UIRequiredDeviceCapabilities, 126
UIScrollViewDelegate protocol, 104
UISegmentedControl class, 90–91
UISlider, 95
UISplitViewController
detail pane, 116
iPad-specific UISplitViewController, 117
master pane, 116
Master-Detail Application template, 117, 118
NSArray, 118
-splitViewController:shouldHideViewController:inOrientation: method, 118
UISplitViewControllerDelegate protocol, 118
UISwipeGestureRecognizerDirectionDown, 110
UISwipeGestureRecognizerDirectionLeft, 110
UISwipeGestureRecognizerDirectionRight, 110
UISwipeGestureRecognizerDirectionUp, 110
UISwitch, 96
UITabBarController
UITabBarItem, 115
-viewDidLoad method, 115
UITableView
editing
deletion, 340
editButtonItem property, 337
-setEditing:animated: method, 338
-tableView:commitEditingStyle:forRowAtIndexPath:, 341–342
UITableView delegate methods, 342
-fetchEvents method, 286
group creation
accessoryButtonTappedForRowWithIndexPath:, 347
commitEditingStyle:forRowAtIndexPath:, 348
didSelectRowAtIndexPath, 347
moveRowAtIndexPath:toIndexPath:, 347
NSDictionary, 349
NSMutableArray, 345
numberOfRowsInSection, 346
table's "Style, 345
-tableView:viewForFooterInSection:, 350
-tableView:cellForRowAtIndexPath:, 346
viewForHeaderInSection, 350
NSMutableDictionary, 286
tableViewEvents, 285
UITableViewDataSource protocols, 286
ungrouped table creation
adding files, 321
basic application, 324
-beginUpdates, 333
Cell View Customization, 336–337
cell.textLabel.text property, 325
cellForRowAtIndexPath: method, 322
CellIdentifier, 323
country objects, 320
CountryInfoViewController, 328, 330, 332
delegate methods, 322
-dequeueReusableCellWith Identifier, 323
didFinishLaunchingWithOptions, 324
-endUpdates, 333
enhanced user interaction, 334–336
flag images, 326
imageView, 325
layer property, 327
MainTableViewController, 318
numberOfRowsInSection: method, 322
revertButton, 331
-tableView:cellForRowAtIndex Path:, 325
UIImage, 325
UINavigationController, 323–324
UITextFieldDelegate protocol, 329
-viewWillAppear:animated: method, 330
XIB file, 319
-viewDidUnload, 285
UITableViewCell prototypes, 72
AppUITableViewCellClass addition, 76, 77
cell identifier, 75
configuring cells, 75
dynamic prototype reselection, 74
MyAppClass, 77
new table view, 74
outlet connection, 75
segue reconfiguration, 75
subclass, 73
UILabel and UIimage outlet property, 73
UITextField
app with enabled functionality, 94
configuration, 93
Interface Builder, 92
notifications, 92
UITextView addition, XIB interface, 92
-viewDidLoad method, 91
XIBfile, 91
UITextFieldDelegate protocol, 93–94, 102
UITextViewDelegate protocol, 102
UITextViewTextDidBeginEditingNotification, 102
UITextViewTextDidChangeNotification, 102
UITextViewTextDidEndEditingNotification, 102
UIViewContentModeScaleAspectFill, 101, 212
UIViewContentModeScaleAspectFit, 101, 212
-updateCurrentPageDisplay method, 98
User data
address book
__bridge_transfer, 302
ABMultiValueCopyValueAtIndex() function, 302–303
ABPeoplePickerNavigationController, 300–301
ABRecordCopyValue(), 301
ABRecordRef, 301
CFRelease() command, 302
-findPressed, 300
property names, 300
XIB file, 299
contact information setting, 305–311
NSCalendar and NSDate
calendar types, 280
NSDateComponents classes, 279
NSUInteger unitFlags, 281
user interface, calendar conversion, 277, 278
simple events creation
delegate, 295
EKEvent, 291
EventAddViewController, 293, 296
MainViewController, 296
toolBarTop, 291
UITextField, 294
UIToolbar, 291
UIViewController subclass, 292
UITableView
-fetchEvents method, 286
NSMutableDictionary, 286
tableViewEvents, 285
UITableViewDataSource protocols, 286
-viewDidUnload, 285
viewing,editing,and deleting events, 288–291
-velocityInView: method, 110
verticalAccuracy property, 133
View controllers
UINavigationController
back button, 113
configuration, 113
-initWithRootViewController:, 112
-pushViewController:animated:method, 112
right bar item(s), 114
root view controller, 112
-setToolbarHidden:animated: method, 114
-setToolbarItems: method, 114
title, 113
UINavigationControllerDelegate protocol, 114
-viewDidLoad methods, 114
-viewWillAppear:animated: method, 114
viewWillDisappear:animated: method, 114
UIPageViewController, 120
UISplitViewController
detail pane, 116
iPad-specific UISplitViewController, 117
master pane, 116
Master-Detail Application template, 117, 118
NSArray, 118
-splitViewController:shouldHideViewController:inOrientation: method, 118
UISplitViewControllerDelegate protocol, 118
UITabBarController
UITabBarItem, 115
-viewDidLoad method, 115
-viewWillAppear method, 227
-viewWillDisappear method, 227
-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation method, 140
Xcode 4
ARC (see Automatic Reference Counting (ARC))
user interface, 1 (see also Interface Builder)
Assistant Editor, 4
Timeline Editor, 4
version control
local Git repository (seeLocal Git repository, Xcode 4)
source control practices, 20