TABBED BAR APPLICATION
Transcript: Launch Screen Create a tab application that has: notifications sound app icon tab icons launch screen vibration iAds InAppPurchase Facebook Open a new project and delete those old viewcontrollers.h and .m because they can't read table views... SOUND! Challenge! Developer License, Certificates and Provisioning Profiles avc.h Saving a String Advantages: ObjC API Sounds can be any duration Source can be file, memory or stream Can play multiple sounds at once Can play in the background Can monitor info better Disadvantages: No precise timing Limited access to audio data limited ability to alter stream This was commented out Attempt the following: tvc.m So, a delegate in iOS development, is kind of like the idea of a delegate in real life, in politics, or in business. It's a formal way that one person can entrust responsibilities to another person. For us as developers, delegation is a formal way that one object can entrust work to another object. Many classes in iOS, including built in classes like the provided user interface elements. Take care of a lot of their own normal internal processing. The Social App iOS Objective C Development TableViewController.h Twitter Create a random PList Application that will give you an inspirational quote. ViewController.h tvc.m Delegate IRL We set up the editing style and made sure that the row that was deleted goes away. and set up an error for ourselves. When it deletes it gives us a nice animation AVFoundation But they can also be connected to your objects, your view controllers, or even completely custom classes. And can delegate certain responsibilities to those objects, just passing over some of their capabilities so that other object can take care of it. tvc.m An instance of NSManagedObjectContext represents a single “object space” or scratch pad in an application. Its primary responsibility is to manage a collection of managed objects. These objects form a group of related model objects that represent an internally consistent view of one or more persistent stores. A single managed object instance exists in one and only one context, but multiple copies of an object can exist in different contexts. Thus object uniquing is scoped to a particular context. Life-cycle Management The context is a powerful object with a central role in the life-cycle of managed objects, with responsibilities from life-cycle management (including faulting) to validation, inverse relationship handling, and undo/redo. Through a context you can retrieve or “fetch” objects from a persistent store, make changes to those objects, and then either discard the changes or—again through the context—commit them back to the persistent store. The context is responsible for watching for changes in its objects and maintains an undo manager so you can have finer-grained control over undo and redo. You can insert new objects and delete ones you have fetched, and commit these modifications to the persistent store. All objects fetched from an external store are registered in a context together with a global identifier (an instance of NSManagedObjectID) that’s used to uniquely identify each object to the external store. tvc.m //this was commented out An NSManagedObjectModel object describes a schema—a collection of entities (data models) that you use in your application. The model contains one or more NSEntityDescription objects representing the entities in the schema. Each NSEntityDescription object has property description objects (instances of subclasses of NSPropertyDescription) that represent the properties (or fields) of the entity in the schema. The Core Data framework uses this description in several ways: Constraining UI creation in Interface Builder Validating attribute and relationship values at runtime Mapping between your managed objects and a database or file-based schema for object persistence. A managed object model maintains a mapping between each of its entity objects and a corresponding managed object class for use with the persistent storage mechanisms in the Core Data Framework. You can determine the entity for a particular managed object with the entity method. You typically create managed object models using the data modeling tool in Xcode, but it is possible to build a model programmatically if needed. Challenge! CHALLENGE avc.m Naming starts with the name of the NSObject doing the delegation, which is then followed by a verb that describes what the object is doing, such as did, will, should, or has. Let's take another object that we've all seen before, UIScrollView. It has a delegate protocol that you can adhere to as well, and it has delegate methods such as: scrollViewDidScroll, scrollViewWillBeginDragging, and so on and so forth. If I were to have a custom object named car, and I wanted to be informed of what happens when the car starts or stops, I'd probably name its delegate methods carDidStart, carWillStart, carHasStarted, carDidStop, and carWillStop. addviewcontroller.m avc.m These