SlideShare una empresa de Scribd logo
1 de 53
INTRODUCTION
TO CORE DATA
TO CORE DATA
Orlando iOS Developer Group
01/23/2013




 Scott Ahten                  AHTEN INDUSTRIES
Who Am I?


Scott Ahten, Ahten Industries
Technologist, iOS Developer
scott@ahtenindustries.com
Topics Covered

What is Core Data?
When should I use Core Data?
Framework overview
Using Core Data
Migrations
Threading & concurrency types
What is Core Data


Not a Database!
Not an Object Relational Mapping framework
What is Core Data

Object Persistence Framework
CRUD operations
Queries using NSPredicate
  Aggregate queries
Multiple persistent store
Available on iOS and Mac OS X Desktop
Persistent
Store Types
Store Types
Binary
In Memory
XML (Desktop Only)
SQLite
Custom Types
Core Data vs. SQLite
                         SQLite   Core Data
   Multiple Update        YES       NO
   Multiple Delete        YES       NO
Auto Populate Objects     NO        YES
    Custom SQL            YES       NO
      Automatic
Lightweight Migrations    NO        YES
       Speed              YES       YES
   Model Objects          NO        YES
When Should I
Use CoreData?
Use CoreData?
Wrong Question
When Shouldn’t I use Core Data?
Really Fast - Highly Optimized by Apple
All but trivial and special cases
You should be using Model objects
Core Data and MVC

    View
    View               Controller
                       Controller




             Model
             Model



           Core Data
Model Objects

NSManagedObject subclass
Lifecycle events
Validation
Faulting
Undo Support
Relationships
Core Data Framework
                             Application
                             Application


                         NSManagedObject
                         NSManagedObject


                      NSManageObjectContext
                      NSManageObjectContext


    NSPersistentStoreCoordinator
    NSPersistentStoreCoordinator       NSManageObjectModel
                                       NSManageObjectModel


                         NSPersistentStore
                         NSPersistentStore


     XML
     XML       SQLite
               SQLite      Binary
                           Binary     Memory
                                      Memory       Custom
                                                   Custom
Core Data Stack


Setup in App Delegate
Xcode Core Data template
NSPersistentStoreCoordinator




 Coordinates access to one or more persistent stores
 Managed Object Model
 Set store options
NSPersistentStoreCoordinator

// Returns the persistent store coordinator for the application.
// If the coordinator doesn't already exist, it is created and the application's store added to it.
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator
{
    if (_persistentStoreCoordinator != nil) {
        return _persistentStoreCoordinator;
    }

    NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"Example_App.sqlite"];

  NSError *error = nil;
  _persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self
managedObjectModel]];
  if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL
options:nil error:&error]) {
           NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
      abort();
  }

    return _persistentStoreCoordinator;
}
NSPersistentStoreCoordinator

// Returns the persistent store coordinator for the application.
// If the coordinator doesn't already exist, it is created and the application's store added to it.
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator
{
    if (_persistentStoreCoordinator != nil) {
        return _persistentStoreCoordinator;
    }

    NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"Example_App.sqlite"];

  NSError *error = nil;
  _persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self
managedObjectModel]];
  if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL
options:nil error:&error]) {
           NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
      abort();
  }

    return _persistentStoreCoordinator;
}
NSPersistentStoreCoordinator

// Returns the persistent store coordinator for the application.
// If the coordinator doesn't already exist, it is created and the application's store added to it.
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator
{
    if (_persistentStoreCoordinator != nil) {
        return _persistentStoreCoordinator;
    }

    NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"Example_App.sqlite"];

  NSError *error = nil;
  _persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self
managedObjectModel]];
  if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL
options:nil error:&error]) {
           NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
      abort();
  }

    return _persistentStoreCoordinator;
}
NSPersistentStoreCoordinator

// Returns the persistent store coordinator for the application.
// If the coordinator doesn't already exist, it is created and the application's store added to it.
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator
{
    if (_persistentStoreCoordinator != nil) {
        return _persistentStoreCoordinator;
    }

    NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"Example_App.sqlite"];

  NSError *error = nil;
  _persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self
managedObjectModel]];
  if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL
options:nil error:&error]) {
           NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
      abort();
  }

    return _persistentStoreCoordinator;
}
NSManagedObjectModel


 Schema for Models
 Entities, properties, relationships, etc.
 Validations
 Fetch Requests
 Configurations
 Objective-C Subclass
NSManagedObjectModel
Attribute Types
 Integer Types
 Decimal
 Double
 Float
 String
 Boolean
 Date
 Binary Data
Other Types?



 Serialize to NSData via NSCoder
 Value Transformer and Transformable type
   Opaque to Queries
 NSManagedObject subclass
Attribute Options



 Transient
 Optional
 Indexed
 Default Values
 Store in external record file (iOS 5 >=)
Relationships

 NSSet, not NSArray
 One to one
 One to many and many to many
   Minimum and maximum count
   Ordered returned NSOrderedSet (iOS 5>=)
 Delete Rules
   Nullify, Cascade, Deny
NSManagedObjectModel


// Returns the managed object model for the application.
// If the model doesn't already exist, it is created from the application's model.
- (NSManagedObjectModel *)managedObjectModel
{
    if (_managedObjectModel != nil) {
        return _managedObjectModel;
    }
    NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"Example_App" withExtension:@"momd"];
    _managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];
    return _managedObjectModel;
}
NSManagedObjectModel


// Returns the managed object model for the application.
// If the model doesn't already exist, it is created from the application's model.
- (NSManagedObjectModel *)managedObjectModel
{
    if (_managedObjectModel != nil) {
        return _managedObjectModel;
    }
    NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"Example_App" withExtension:@"momd"];
    _managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];
    return _managedObjectModel;
}
NSManagedObjectModel


// Returns the managed object model for the application.
// If the model doesn't already exist, it is created from the application's model.
- (NSManagedObjectModel *)managedObjectModel
{
    if (_managedObjectModel != nil) {
        return _managedObjectModel;
    }
    NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"Example_App" withExtension:@"momd"];
    _managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];
    return _managedObjectModel;
}
NSManagedObjectContext

Scratch Pad for Entities
Queried objects are pulled into context
  Can be Faulted
Entities inserted into context
Changes are not persisted until calling save:
NSManagedObjectContext

Not thread safe!
One context per thread
More than one context per coordinator
  Merge notifications
Concurrency Types (iOS 5>=)
  Blocks, GCD queues
NSManagedObjectContext

// Returns the managed object context for the application.
// If the context doesn't already exist, it is created and bound to the persistent store coordinator for the application.
- (NSManagedObjectContext *)managedObjectContext
{
    if (_managedObjectContext != nil) {
        return _managedObjectContext;
    }

    NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator];
    if (coordinator != nil) {
        _managedObjectContext = [[NSManagedObjectContext alloc] init];
        [_managedObjectContext setPersistentStoreCoordinator:coordinator];
    }
    return _managedObjectContext;
}
NSManagedObjectContext

// Returns the managed object context for the application.
// If the context doesn't already exist, it is created and bound to the persistent store coordinator for the application.
- (NSManagedObjectContext *)managedObjectContext
{
    if (_managedObjectContext != nil) {
        return _managedObjectContext;
    }

    NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator];
    if (coordinator != nil) {
        _managedObjectContext = [[NSManagedObjectContext alloc] init];
        [_managedObjectContext setPersistentStoreCoordinator:coordinator];
    }
    return _managedObjectContext;
}
Saving

Save occurs per context
Saves changes to persistent store
Should save on applicationWillTerminate:
Can be reset to discard changes
Saving


- (void)saveContext
{
    NSError *error = nil;
    NSManagedObjectContext *managedObjectContext = self.managedObjectContext;
    if (managedObjectContext != nil) {
   if ([managedObjectContext hasChanges] && ![managedObjectContext save:&error])
{
       // Replace this implementation with code to handle the error appropriately.
       }
    }
}
NSManagedObject

Represents an entity in your model
Superclass of managed object subclasses
Access attributes via KVC/KVO and properties
Pass NSManagedObjectIDs between threads
Xcode can generate subclass with accessors
Can be a fault
Querying Entites
NSPredicate
Rich query syntax
Aggregate property values
Compound predicates
Queries can return faulted entities based on result
type
Batch size
Faults

Only object ID
Performance & memory
Include specific properties
Prefetch relationships
Querying Entites
NSManagedObjectContext *managedObjectContext = [self managedObjectContext];

NSFetchRequest *request = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Event"
inManagedObjectContext:managedObjectContext];
[request setEntity:entity];

NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"creationDate" ascending:NO];
NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil];
[request setSortDescriptors:sortDescriptors];


NSError *error = nil;
NSMutableArray *mutableFetchResults = [[managedObjectContext executeFetchRequest:request error:&error]
mutableCopy];
if (mutableFetchResults == nil) {
    // Handle the error.
}
Querying Entites
NSManagedObjectContext *managedObjectContext = [self managedObjectContext];

NSFetchRequest *request = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Event"
inManagedObjectContext:managedObjectContext];
[request setEntity:entity];

NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"creationDate" ascending:NO];
NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil];
[request setSortDescriptors:sortDescriptors];


NSError *error = nil;
NSMutableArray *mutableFetchResults = [[managedObjectContext executeFetchRequest:request error:&error]
mutableCopy];
if (mutableFetchResults == nil) {
    // Handle the error.
}
Querying Entites
NSManagedObjectContext *managedObjectContext = [self managedObjectContext];

NSFetchRequest *request = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Event"
inManagedObjectContext:managedObjectContext];
[request setEntity:entity];

NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"creationDate" ascending:NO];
NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil];
[request setSortDescriptors:sortDescriptors];


NSError *error = nil;
NSMutableArray *mutableFetchResults = [[managedObjectContext executeFetchRequest:request error:&error]
mutableCopy];
if (mutableFetchResults == nil) {
    // Handle the error.
}
Querying Entites
NSManagedObjectContext *managedObjectContext = [self managedObjectContext];

NSFetchRequest *request = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Event"
inManagedObjectContext:managedObjectContext];
[request setEntity:entity];

NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"creationDate" ascending:NO];
NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil];
[request setSortDescriptors:sortDescriptors];


NSError *error = nil;
NSMutableArray *mutableFetchResults = [[managedObjectContext executeFetchRequest:request error:&error]
mutableCopy];
if (mutableFetchResults == nil) {
    // Handle the error.
}
Predicates

NSPredicate *predicate = [NSPredicate predicateWithFormat:@"grade > %d", 7];



NSPredicate *testForTrue =
  [NSPredicate predicateWithFormat:@"anAttribute == YES"];



NSPredicate *predicate = [NSPredicate
  predicateWithFormat:@"(lastName like[cd] %@) AND (birthday > %@)",
          lastNameSearchString, birthdaySearchDate];



[fetchRequest setPredicate:predicate];
Inserting Entities


 Insert into managed object context
 Entities are not yet persisted until context is saved
Inserting Entities

- (void)insertNewObject:(id)sender
{
   NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext];
   NSEntityDescription *entity = [[self.fetchedResultsController fetchRequest] entity];
   NSManagedObject *newManagedObject = [NSEntityDescription insertNewObjectForEntityForName:[entity name]
inManagedObjectContext:context];

  // If appropriate, configure the new managed object.
  // Normally you should use accessor methods, but using KVC here avoids the need to add a custom class to the
template.
  [newManagedObject setValue:[NSDate date] forKey:@"timeStamp"];

    // Save the context.
    NSError *error = nil;
    if (![context save:&error]) {
         // Replace this implementation with code to handle the error appropriately.
    }
}
Inserting Entities

- (void)insertNewObject:(id)sender
{
   NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext];
   NSEntityDescription *entity = [[self.fetchedResultsController fetchRequest] entity];
   NSManagedObject *newManagedObject = [NSEntityDescription insertNewObjectForEntityForName:[entity name]
inManagedObjectContext:context];

  // If appropriate, configure the new managed object.
  // Normally you should use accessor methods, but using KVC here avoids the need to add a custom class to the
template.
  [newManagedObject setValue:[NSDate date] forKey:@"timeStamp"];

    // Save the context.
    NSError *error = nil;
    if (![context save:&error]) {
         // Replace this implementation with code to handle the error appropriately.
    }
}
Inserting Entities

- (void)insertNewObject:(id)sender
{
   NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext];
   NSEntityDescription *entity = [[self.fetchedResultsController fetchRequest] entity];
   NSManagedObject *newManagedObject = [NSEntityDescription insertNewObjectForEntityForName:[entity name]
inManagedObjectContext:context];

  // If appropriate, configure the new managed object.
  // Normally you should use accessor methods, but using KVC here avoids the need to add a custom class to the
template.
  [newManagedObject setValue:[NSDate date] forKey:@"timeStamp"];

    // Save the context.
    NSError *error = nil;
    if (![context save:&error]) {
         // Replace this implementation with code to handle the error appropriately.
    }
}
Inserting Entities

- (void)insertNewObject:(id)sender
{
   NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext];
   NSEntityDescription *entity = [[self.fetchedResultsController fetchRequest] entity];
   NSManagedObject *newManagedObject = [NSEntityDescription insertNewObjectForEntityForName:[entity name]
inManagedObjectContext:context];

  // If appropriate, configure the new managed object.
  // Normally you should use accessor methods, but using KVC here avoids the need to add a custom class to the
template.
  [newManagedObject setValue:[NSDate date] forKey:@"timeStamp"];

    // Save the context.
    NSError *error = nil;
    if (![context save:&error]) {
         // Replace this implementation with code to handle the error appropriately.
    }
}
Deleting Entites

 Entities are marked as deleted
 No longer returned in queries
 Not actually deleted until context is saved
 Deletes can be discarded before save by discarding
 or resetting the context
Deleting Entites


- (void)deleteEvent:(NSManagedObject*)event
{
   NSManagedObjectContext *managedObjectContext = [self managedObjectContext];

    NSError *error = nil;
    [managedObjectContext deleteObject: event];
    if (![managedObjectContext save:&error]) {
        // Replace this implementation with code to handle the error appropriately.
    }
}
Updating Entities


Same as insert
Change properties and save context
Updates can be discarded before save by discarding
or resetting the context
Migrations

Schemas change
Create new model version
Automatic lightweight migration
Manual migration
Not all changes require migration
  Validation, default values, Objective-C class
Concurency Types
iOS 5 >=
NSConfinementConcurrencyType
 Pre iOS 5 Concurrency
NSPrivateQueueConcurrencyType
 Private dispatch queue
NSMainQueueConcurrencyType
 Main Queue
Resources
Core Data Programming Guide
http://developer.apple.com/library/mac/#
documentation/cocoa/Conceptual/CoreData/cdProgrammingGuide.html

Predicate Programming Guide
http://developer.apple.com/library/mac/#
documentation/Cocoa/Conceptual/Predicates/predicates.html

Grand Central Dispatch (GCD)
http://developer.apple.com/library/ios/#
documentation/Performance/Reference/GCD_libdispatch_Ref/Reference/referen
ce.html
Resources

Magical Record
http://developer.apple.com/library/mac/#
documentation/cocoa/Conceptual/CoreData/cdProgrammingGuide.html

Multi-Context Core Data
http://www.cocoanetics.com/2012/07/multi-context-coredata/

Core Data Editor
http://christian-kienle.de/CoreDataEditor
Q&A

Más contenido relacionado

La actualidad más candente

To Study The Tips Tricks Guidelines Related To Performance Tuning For N Hib...
To Study The Tips Tricks  Guidelines Related To Performance Tuning For  N Hib...To Study The Tips Tricks  Guidelines Related To Performance Tuning For  N Hib...
To Study The Tips Tricks Guidelines Related To Performance Tuning For N Hib...Shahzad
 
Object Oriented Programing in JavaScript
Object Oriented Programing in JavaScriptObject Oriented Programing in JavaScript
Object Oriented Programing in JavaScriptAkshay Mathur
 
Advanced Hibernate Notes
Advanced Hibernate NotesAdvanced Hibernate Notes
Advanced Hibernate NotesKaniska Mandal
 
White Paper On ConCurrency For PCMS Application Architecture
White Paper On ConCurrency For PCMS Application ArchitectureWhite Paper On ConCurrency For PCMS Application Architecture
White Paper On ConCurrency For PCMS Application ArchitectureShahzad
 
OR Mapping- nhibernate Presentation
OR Mapping- nhibernate PresentationOR Mapping- nhibernate Presentation
OR Mapping- nhibernate PresentationShahzad
 
Creating Single Page Web App using Backbone JS
Creating Single Page Web App using Backbone JSCreating Single Page Web App using Backbone JS
Creating Single Page Web App using Backbone JSAkshay Mathur
 
Hibernate Tutorial
Hibernate TutorialHibernate Tutorial
Hibernate TutorialRam132
 
Kabukiza.tech 1 LT - ScalikeJDBC-Async & Skinny Framework #kbkz_tech
Kabukiza.tech 1 LT - ScalikeJDBC-Async & Skinny Framework #kbkz_techKabukiza.tech 1 LT - ScalikeJDBC-Async & Skinny Framework #kbkz_tech
Kabukiza.tech 1 LT - ScalikeJDBC-Async & Skinny Framework #kbkz_techKazuhiro Sera
 
Multithreading on iOS
Multithreading on iOSMultithreading on iOS
Multithreading on iOSMake School
 
Multi-threaded CoreData Done Right
Multi-threaded CoreData Done RightMulti-threaded CoreData Done Right
Multi-threaded CoreData Done Rightmorrowa_de
 
Wcf data services
Wcf data servicesWcf data services
Wcf data servicesEyal Vardi
 
Cocoa heads testing and viewcontrollers
Cocoa heads testing and viewcontrollersCocoa heads testing and viewcontrollers
Cocoa heads testing and viewcontrollersStijn Willems
 
ScalikeJDBC Tutorial for Beginners
ScalikeJDBC Tutorial for BeginnersScalikeJDBC Tutorial for Beginners
ScalikeJDBC Tutorial for BeginnersKazuhiro Sera
 
Introduction to hibernate
Introduction to hibernateIntroduction to hibernate
Introduction to hibernatehr1383
 
Introduction to Struts
Introduction to StrutsIntroduction to Struts
Introduction to Strutselliando dias
 
Understanding backbonejs
Understanding backbonejsUnderstanding backbonejs
Understanding backbonejsNick Lee
 
JPA 2.1 performance tuning tips
JPA 2.1 performance tuning tipsJPA 2.1 performance tuning tips
JPA 2.1 performance tuning tipsosa_ora
 

La actualidad más candente (20)

To Study The Tips Tricks Guidelines Related To Performance Tuning For N Hib...
To Study The Tips Tricks  Guidelines Related To Performance Tuning For  N Hib...To Study The Tips Tricks  Guidelines Related To Performance Tuning For  N Hib...
To Study The Tips Tricks Guidelines Related To Performance Tuning For N Hib...
 
Object Oriented Programing in JavaScript
Object Oriented Programing in JavaScriptObject Oriented Programing in JavaScript
Object Oriented Programing in JavaScript
 
Advanced Hibernate Notes
Advanced Hibernate NotesAdvanced Hibernate Notes
Advanced Hibernate Notes
 
White Paper On ConCurrency For PCMS Application Architecture
White Paper On ConCurrency For PCMS Application ArchitectureWhite Paper On ConCurrency For PCMS Application Architecture
White Paper On ConCurrency For PCMS Application Architecture
 
OR Mapping- nhibernate Presentation
OR Mapping- nhibernate PresentationOR Mapping- nhibernate Presentation
OR Mapping- nhibernate Presentation
 
Creating Single Page Web App using Backbone JS
Creating Single Page Web App using Backbone JSCreating Single Page Web App using Backbone JS
Creating Single Page Web App using Backbone JS
 
CDI 2.0 Deep Dive
CDI 2.0 Deep DiveCDI 2.0 Deep Dive
CDI 2.0 Deep Dive
 
Hibernate Tutorial
Hibernate TutorialHibernate Tutorial
Hibernate Tutorial
 
Kabukiza.tech 1 LT - ScalikeJDBC-Async & Skinny Framework #kbkz_tech
Kabukiza.tech 1 LT - ScalikeJDBC-Async & Skinny Framework #kbkz_techKabukiza.tech 1 LT - ScalikeJDBC-Async & Skinny Framework #kbkz_tech
Kabukiza.tech 1 LT - ScalikeJDBC-Async & Skinny Framework #kbkz_tech
 
Multithreading on iOS
Multithreading on iOSMultithreading on iOS
Multithreading on iOS
 
Multi-threaded CoreData Done Right
Multi-threaded CoreData Done RightMulti-threaded CoreData Done Right
Multi-threaded CoreData Done Right
 
Wcf data services
Wcf data servicesWcf data services
Wcf data services
 
hibernate with JPA
hibernate with JPAhibernate with JPA
hibernate with JPA
 
Cocoa heads testing and viewcontrollers
Cocoa heads testing and viewcontrollersCocoa heads testing and viewcontrollers
Cocoa heads testing and viewcontrollers
 
ScalikeJDBC Tutorial for Beginners
ScalikeJDBC Tutorial for BeginnersScalikeJDBC Tutorial for Beginners
ScalikeJDBC Tutorial for Beginners
 
Introduction to hibernate
Introduction to hibernateIntroduction to hibernate
Introduction to hibernate
 
Introduction to Struts
Introduction to StrutsIntroduction to Struts
Introduction to Struts
 
Spring data jpa
Spring data jpaSpring data jpa
Spring data jpa
 
Understanding backbonejs
Understanding backbonejsUnderstanding backbonejs
Understanding backbonejs
 
JPA 2.1 performance tuning tips
JPA 2.1 performance tuning tipsJPA 2.1 performance tuning tips
JPA 2.1 performance tuning tips
 

Destacado

Anuncio BOPBUR Subasta Licitacion Coto Caza Espinosa de los Monteros
Anuncio BOPBUR Subasta Licitacion Coto Caza Espinosa de los MonterosAnuncio BOPBUR Subasta Licitacion Coto Caza Espinosa de los Monteros
Anuncio BOPBUR Subasta Licitacion Coto Caza Espinosa de los MonterosCEDER Merindades
 
Use of magnets in orthodontics /certified fixed orthodontic courses by Indi...
Use  of magnets in orthodontics  /certified fixed orthodontic courses by Indi...Use  of magnets in orthodontics  /certified fixed orthodontic courses by Indi...
Use of magnets in orthodontics /certified fixed orthodontic courses by Indi...Indian dental academy
 
John hyman joins cheyne hedge fund
John hyman joins cheyne hedge fundJohn hyman joins cheyne hedge fund
John hyman joins cheyne hedge fundCheyne Capital
 
Adaptación OpenGeo Suite Castellbisbal
Adaptación OpenGeo Suite CastellbisbalAdaptación OpenGeo Suite Castellbisbal
Adaptación OpenGeo Suite CastellbisbalOscar Fonts
 
Unic pag internas repositorio del programa apartado investigación
Unic pag internas repositorio del programa apartado investigaciónUnic pag internas repositorio del programa apartado investigación
Unic pag internas repositorio del programa apartado investigaciónmmolina2010
 
Cuentos Sobre Alan Garcia
Cuentos Sobre Alan GarciaCuentos Sobre Alan Garcia
Cuentos Sobre Alan Garciaalphasoundd
 
Boletin nayarit mayo junio
Boletin nayarit mayo junioBoletin nayarit mayo junio
Boletin nayarit mayo junioOscar Neri
 
Plan estratégico del PROYECTO CALMARR
Plan estratégico del PROYECTO CALMARRPlan estratégico del PROYECTO CALMARR
Plan estratégico del PROYECTO CALMARRCalmarr Almería
 
I Nvitacion Dia Dentista
I Nvitacion Dia DentistaI Nvitacion Dia Dentista
I Nvitacion Dia Dentistaavatarz
 
Benefits of the OSGi Solution for Manufacturers and Service Providers - S Sch...
Benefits of the OSGi Solution for Manufacturers and Service Providers - S Sch...Benefits of the OSGi Solution for Manufacturers and Service Providers - S Sch...
Benefits of the OSGi Solution for Manufacturers and Service Providers - S Sch...mfrancis
 
Lesson Plan Kinder1
Lesson Plan Kinder1Lesson Plan Kinder1
Lesson Plan Kinder1DarioB410
 
exercises Chapter 1 Energy, Enviroment and climate second edition
exercises Chapter 1 Energy, Enviroment and climate second edition exercises Chapter 1 Energy, Enviroment and climate second edition
exercises Chapter 1 Energy, Enviroment and climate second edition Aditya Wibawa
 

Destacado (20)

Anuncio BOPBUR Subasta Licitacion Coto Caza Espinosa de los Monteros
Anuncio BOPBUR Subasta Licitacion Coto Caza Espinosa de los MonterosAnuncio BOPBUR Subasta Licitacion Coto Caza Espinosa de los Monteros
Anuncio BOPBUR Subasta Licitacion Coto Caza Espinosa de los Monteros
 
Chapter 8 levinas
Chapter 8   levinasChapter 8   levinas
Chapter 8 levinas
 
Use of magnets in orthodontics /certified fixed orthodontic courses by Indi...
Use  of magnets in orthodontics  /certified fixed orthodontic courses by Indi...Use  of magnets in orthodontics  /certified fixed orthodontic courses by Indi...
Use of magnets in orthodontics /certified fixed orthodontic courses by Indi...
 
Kommunalprogramm 2014 Magazin
Kommunalprogramm 2014 MagazinKommunalprogramm 2014 Magazin
Kommunalprogramm 2014 Magazin
 
John hyman joins cheyne hedge fund
John hyman joins cheyne hedge fundJohn hyman joins cheyne hedge fund
John hyman joins cheyne hedge fund
 
Como implementar nuevas evaluaciones
Como implementar nuevas evaluacionesComo implementar nuevas evaluaciones
Como implementar nuevas evaluaciones
 
Biomoleculas
BiomoleculasBiomoleculas
Biomoleculas
 
Adaptación OpenGeo Suite Castellbisbal
Adaptación OpenGeo Suite CastellbisbalAdaptación OpenGeo Suite Castellbisbal
Adaptación OpenGeo Suite Castellbisbal
 
Unic pag internas repositorio del programa apartado investigación
Unic pag internas repositorio del programa apartado investigaciónUnic pag internas repositorio del programa apartado investigación
Unic pag internas repositorio del programa apartado investigación
 
Cuentos Sobre Alan Garcia
Cuentos Sobre Alan GarciaCuentos Sobre Alan Garcia
Cuentos Sobre Alan Garcia
 
Boletin nayarit mayo junio
Boletin nayarit mayo junioBoletin nayarit mayo junio
Boletin nayarit mayo junio
 
Plan estratégico del PROYECTO CALMARR
Plan estratégico del PROYECTO CALMARRPlan estratégico del PROYECTO CALMARR
Plan estratégico del PROYECTO CALMARR
 
I Nvitacion Dia Dentista
I Nvitacion Dia DentistaI Nvitacion Dia Dentista
I Nvitacion Dia Dentista
 
Benefits of the OSGi Solution for Manufacturers and Service Providers - S Sch...
Benefits of the OSGi Solution for Manufacturers and Service Providers - S Sch...Benefits of the OSGi Solution for Manufacturers and Service Providers - S Sch...
Benefits of the OSGi Solution for Manufacturers and Service Providers - S Sch...
 
Ruth alvarez molina
Ruth alvarez molinaRuth alvarez molina
Ruth alvarez molina
 
UGC NET - JUNE-2010- PAPER-I-SET-W
UGC NET - JUNE-2010- PAPER-I-SET-WUGC NET - JUNE-2010- PAPER-I-SET-W
UGC NET - JUNE-2010- PAPER-I-SET-W
 
3 m deber direccion E
3 m deber direccion E3 m deber direccion E
3 m deber direccion E
 
Lesson Plan Kinder1
Lesson Plan Kinder1Lesson Plan Kinder1
Lesson Plan Kinder1
 
6 anticonceptiv-3
6 anticonceptiv-36 anticonceptiv-3
6 anticonceptiv-3
 
exercises Chapter 1 Energy, Enviroment and climate second edition
exercises Chapter 1 Energy, Enviroment and climate second edition exercises Chapter 1 Energy, Enviroment and climate second edition
exercises Chapter 1 Energy, Enviroment and climate second edition
 

Similar a Core data orlando i os dev group

Core Data with Swift 3.0
Core Data with Swift 3.0Core Data with Swift 3.0
Core Data with Swift 3.0Korhan Bircan
 
Intro to Core Data
Intro to Core DataIntro to Core Data
Intro to Core DataMake School
 
Core Data Migration
Core Data MigrationCore Data Migration
Core Data MigrationMonica Kurup
 
Connecting to a REST API in iOS
Connecting to a REST API in iOSConnecting to a REST API in iOS
Connecting to a REST API in iOSgillygize
 
Simpler Core Data with RubyMotion
Simpler Core Data with RubyMotionSimpler Core Data with RubyMotion
Simpler Core Data with RubyMotionStefan Haflidason
 
CocoaHeads PDX 2014 01 23 : CoreData and iCloud Improvements iOS7 / OSX Maver...
CocoaHeads PDX 2014 01 23 : CoreData and iCloud Improvements iOS7 / OSX Maver...CocoaHeads PDX 2014 01 23 : CoreData and iCloud Improvements iOS7 / OSX Maver...
CocoaHeads PDX 2014 01 23 : CoreData and iCloud Improvements iOS7 / OSX Maver...smn-automate
 
Core data WIPJam workshop @ MWC'14
Core data WIPJam workshop @ MWC'14Core data WIPJam workshop @ MWC'14
Core data WIPJam workshop @ MWC'14Diego Freniche Brito
 
Mashup iOS - Core data
Mashup iOS - Core dataMashup iOS - Core data
Mashup iOS - Core datassuser9ef26e
 
10 tips for a reusable architecture
10 tips for a reusable architecture10 tips for a reusable architecture
10 tips for a reusable architectureJorge Ortiz
 
Make your Backbone Application dance
Make your Backbone Application danceMake your Backbone Application dance
Make your Backbone Application danceNicholas Valbusa
 
Core Data Migrations and A Better Option
Core Data Migrations and A Better OptionCore Data Migrations and A Better Option
Core Data Migrations and A Better OptionPriya Rajagopal
 
Core data in Swfit
Core data in SwfitCore data in Swfit
Core data in Swfitallanh0526
 
Data Binding in Silverlight
Data Binding in SilverlightData Binding in Silverlight
Data Binding in SilverlightBoulos Dib
 
Data Abstraction for Large Web Applications
Data Abstraction for Large Web ApplicationsData Abstraction for Large Web Applications
Data Abstraction for Large Web Applicationsbrandonsavage
 
Taking a Test Drive
Taking a Test DriveTaking a Test Drive
Taking a Test DriveGraham Lee
 
MongoDB Days Silicon Valley: Building Applications with the MEAN Stack
MongoDB Days Silicon Valley: Building Applications with the MEAN StackMongoDB Days Silicon Valley: Building Applications with the MEAN Stack
MongoDB Days Silicon Valley: Building Applications with the MEAN StackMongoDB
 

Similar a Core data orlando i os dev group (20)

Core Data with Swift 3.0
Core Data with Swift 3.0Core Data with Swift 3.0
Core Data with Swift 3.0
 
Intro to Core Data
Intro to Core DataIntro to Core Data
Intro to Core Data
 
Core Data Migration
Core Data MigrationCore Data Migration
Core Data Migration
 
Connecting to a REST API in iOS
Connecting to a REST API in iOSConnecting to a REST API in iOS
Connecting to a REST API in iOS
 
Simpler Core Data with RubyMotion
Simpler Core Data with RubyMotionSimpler Core Data with RubyMotion
Simpler Core Data with RubyMotion
 
Data perisistence in iOS
Data perisistence in iOSData perisistence in iOS
Data perisistence in iOS
 
Data perisistance i_os
Data perisistance i_osData perisistance i_os
Data perisistance i_os
 
CocoaHeads PDX 2014 01 23 : CoreData and iCloud Improvements iOS7 / OSX Maver...
CocoaHeads PDX 2014 01 23 : CoreData and iCloud Improvements iOS7 / OSX Maver...CocoaHeads PDX 2014 01 23 : CoreData and iCloud Improvements iOS7 / OSX Maver...
CocoaHeads PDX 2014 01 23 : CoreData and iCloud Improvements iOS7 / OSX Maver...
 
Core data WIPJam workshop @ MWC'14
Core data WIPJam workshop @ MWC'14Core data WIPJam workshop @ MWC'14
Core data WIPJam workshop @ MWC'14
 
Core data optimization
Core data optimizationCore data optimization
Core data optimization
 
Mashup iOS - Core data
Mashup iOS - Core dataMashup iOS - Core data
Mashup iOS - Core data
 
10 tips for a reusable architecture
10 tips for a reusable architecture10 tips for a reusable architecture
10 tips for a reusable architecture
 
Make your Backbone Application dance
Make your Backbone Application danceMake your Backbone Application dance
Make your Backbone Application dance
 
Core Data Migrations and A Better Option
Core Data Migrations and A Better OptionCore Data Migrations and A Better Option
Core Data Migrations and A Better Option
 
Core data in Swfit
Core data in SwfitCore data in Swfit
Core data in Swfit
 
Data Binding in Silverlight
Data Binding in SilverlightData Binding in Silverlight
Data Binding in Silverlight
 
Data Abstraction for Large Web Applications
Data Abstraction for Large Web ApplicationsData Abstraction for Large Web Applications
Data Abstraction for Large Web Applications
 
Taking a Test Drive
Taking a Test DriveTaking a Test Drive
Taking a Test Drive
 
Real World MVC
Real World MVCReal World MVC
Real World MVC
 
MongoDB Days Silicon Valley: Building Applications with the MEAN Stack
MongoDB Days Silicon Valley: Building Applications with the MEAN StackMongoDB Days Silicon Valley: Building Applications with the MEAN Stack
MongoDB Days Silicon Valley: Building Applications with the MEAN Stack
 

Más de Andrew Kozlik

Slack Development and You
Slack Development and YouSlack Development and You
Slack Development and YouAndrew Kozlik
 
3D Touch Implementation for Shortcuts and Peek/Pop Functionality
3D Touch Implementation for Shortcuts and Peek/Pop Functionality3D Touch Implementation for Shortcuts and Peek/Pop Functionality
3D Touch Implementation for Shortcuts and Peek/Pop FunctionalityAndrew Kozlik
 
Leveraging parse.com for Speedy Development
Leveraging parse.com for Speedy DevelopmentLeveraging parse.com for Speedy Development
Leveraging parse.com for Speedy DevelopmentAndrew Kozlik
 
How to start developing iOS apps
How to start developing iOS appsHow to start developing iOS apps
How to start developing iOS appsAndrew Kozlik
 
Last Ace of Space Postmortem
Last Ace of Space PostmortemLast Ace of Space Postmortem
Last Ace of Space PostmortemAndrew Kozlik
 
Generating revenue with AdMob
Generating revenue with AdMobGenerating revenue with AdMob
Generating revenue with AdMobAndrew Kozlik
 

Más de Andrew Kozlik (7)

Slack Development and You
Slack Development and YouSlack Development and You
Slack Development and You
 
3D Touch Implementation for Shortcuts and Peek/Pop Functionality
3D Touch Implementation for Shortcuts and Peek/Pop Functionality3D Touch Implementation for Shortcuts and Peek/Pop Functionality
3D Touch Implementation for Shortcuts and Peek/Pop Functionality
 
Leveraging parse.com for Speedy Development
Leveraging parse.com for Speedy DevelopmentLeveraging parse.com for Speedy Development
Leveraging parse.com for Speedy Development
 
How to start developing iOS apps
How to start developing iOS appsHow to start developing iOS apps
How to start developing iOS apps
 
Mwyf presentation
Mwyf presentationMwyf presentation
Mwyf presentation
 
Last Ace of Space Postmortem
Last Ace of Space PostmortemLast Ace of Space Postmortem
Last Ace of Space Postmortem
 
Generating revenue with AdMob
Generating revenue with AdMobGenerating revenue with AdMob
Generating revenue with AdMob
 

Último

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 

Último (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

Core data orlando i os dev group

  • 1. INTRODUCTION TO CORE DATA TO CORE DATA Orlando iOS Developer Group 01/23/2013 Scott Ahten AHTEN INDUSTRIES
  • 2. Who Am I? Scott Ahten, Ahten Industries Technologist, iOS Developer scott@ahtenindustries.com
  • 3. Topics Covered What is Core Data? When should I use Core Data? Framework overview Using Core Data Migrations Threading & concurrency types
  • 4. What is Core Data Not a Database! Not an Object Relational Mapping framework
  • 5. What is Core Data Object Persistence Framework CRUD operations Queries using NSPredicate Aggregate queries Multiple persistent store Available on iOS and Mac OS X Desktop
  • 6. Persistent Store Types Store Types Binary In Memory XML (Desktop Only) SQLite Custom Types
  • 7. Core Data vs. SQLite SQLite Core Data Multiple Update YES NO Multiple Delete YES NO Auto Populate Objects NO YES Custom SQL YES NO Automatic Lightweight Migrations NO YES Speed YES YES Model Objects NO YES
  • 8. When Should I Use CoreData? Use CoreData? Wrong Question When Shouldn’t I use Core Data? Really Fast - Highly Optimized by Apple All but trivial and special cases You should be using Model objects
  • 9. Core Data and MVC View View Controller Controller Model Model Core Data
  • 10. Model Objects NSManagedObject subclass Lifecycle events Validation Faulting Undo Support Relationships
  • 11. Core Data Framework Application Application NSManagedObject NSManagedObject NSManageObjectContext NSManageObjectContext NSPersistentStoreCoordinator NSPersistentStoreCoordinator NSManageObjectModel NSManageObjectModel NSPersistentStore NSPersistentStore XML XML SQLite SQLite Binary Binary Memory Memory Custom Custom
  • 12. Core Data Stack Setup in App Delegate Xcode Core Data template
  • 13. NSPersistentStoreCoordinator Coordinates access to one or more persistent stores Managed Object Model Set store options
  • 14. NSPersistentStoreCoordinator // Returns the persistent store coordinator for the application. // If the coordinator doesn't already exist, it is created and the application's store added to it. - (NSPersistentStoreCoordinator *)persistentStoreCoordinator { if (_persistentStoreCoordinator != nil) { return _persistentStoreCoordinator; } NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"Example_App.sqlite"]; NSError *error = nil; _persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]]; if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]) { NSLog(@"Unresolved error %@, %@", error, [error userInfo]); abort(); } return _persistentStoreCoordinator; }
  • 15. NSPersistentStoreCoordinator // Returns the persistent store coordinator for the application. // If the coordinator doesn't already exist, it is created and the application's store added to it. - (NSPersistentStoreCoordinator *)persistentStoreCoordinator { if (_persistentStoreCoordinator != nil) { return _persistentStoreCoordinator; } NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"Example_App.sqlite"]; NSError *error = nil; _persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]]; if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]) { NSLog(@"Unresolved error %@, %@", error, [error userInfo]); abort(); } return _persistentStoreCoordinator; }
  • 16. NSPersistentStoreCoordinator // Returns the persistent store coordinator for the application. // If the coordinator doesn't already exist, it is created and the application's store added to it. - (NSPersistentStoreCoordinator *)persistentStoreCoordinator { if (_persistentStoreCoordinator != nil) { return _persistentStoreCoordinator; } NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"Example_App.sqlite"]; NSError *error = nil; _persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]]; if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]) { NSLog(@"Unresolved error %@, %@", error, [error userInfo]); abort(); } return _persistentStoreCoordinator; }
  • 17. NSPersistentStoreCoordinator // Returns the persistent store coordinator for the application. // If the coordinator doesn't already exist, it is created and the application's store added to it. - (NSPersistentStoreCoordinator *)persistentStoreCoordinator { if (_persistentStoreCoordinator != nil) { return _persistentStoreCoordinator; } NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"Example_App.sqlite"]; NSError *error = nil; _persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]]; if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]) { NSLog(@"Unresolved error %@, %@", error, [error userInfo]); abort(); } return _persistentStoreCoordinator; }
  • 18. NSManagedObjectModel Schema for Models Entities, properties, relationships, etc. Validations Fetch Requests Configurations Objective-C Subclass
  • 20. Attribute Types Integer Types Decimal Double Float String Boolean Date Binary Data
  • 21. Other Types? Serialize to NSData via NSCoder Value Transformer and Transformable type Opaque to Queries NSManagedObject subclass
  • 22. Attribute Options Transient Optional Indexed Default Values Store in external record file (iOS 5 >=)
  • 23. Relationships NSSet, not NSArray One to one One to many and many to many Minimum and maximum count Ordered returned NSOrderedSet (iOS 5>=) Delete Rules Nullify, Cascade, Deny
  • 24. NSManagedObjectModel // Returns the managed object model for the application. // If the model doesn't already exist, it is created from the application's model. - (NSManagedObjectModel *)managedObjectModel { if (_managedObjectModel != nil) { return _managedObjectModel; } NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"Example_App" withExtension:@"momd"]; _managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL]; return _managedObjectModel; }
  • 25. NSManagedObjectModel // Returns the managed object model for the application. // If the model doesn't already exist, it is created from the application's model. - (NSManagedObjectModel *)managedObjectModel { if (_managedObjectModel != nil) { return _managedObjectModel; } NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"Example_App" withExtension:@"momd"]; _managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL]; return _managedObjectModel; }
  • 26. NSManagedObjectModel // Returns the managed object model for the application. // If the model doesn't already exist, it is created from the application's model. - (NSManagedObjectModel *)managedObjectModel { if (_managedObjectModel != nil) { return _managedObjectModel; } NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"Example_App" withExtension:@"momd"]; _managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL]; return _managedObjectModel; }
  • 27. NSManagedObjectContext Scratch Pad for Entities Queried objects are pulled into context Can be Faulted Entities inserted into context Changes are not persisted until calling save:
  • 28. NSManagedObjectContext Not thread safe! One context per thread More than one context per coordinator Merge notifications Concurrency Types (iOS 5>=) Blocks, GCD queues
  • 29. NSManagedObjectContext // Returns the managed object context for the application. // If the context doesn't already exist, it is created and bound to the persistent store coordinator for the application. - (NSManagedObjectContext *)managedObjectContext { if (_managedObjectContext != nil) { return _managedObjectContext; } NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator]; if (coordinator != nil) { _managedObjectContext = [[NSManagedObjectContext alloc] init]; [_managedObjectContext setPersistentStoreCoordinator:coordinator]; } return _managedObjectContext; }
  • 30. NSManagedObjectContext // Returns the managed object context for the application. // If the context doesn't already exist, it is created and bound to the persistent store coordinator for the application. - (NSManagedObjectContext *)managedObjectContext { if (_managedObjectContext != nil) { return _managedObjectContext; } NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator]; if (coordinator != nil) { _managedObjectContext = [[NSManagedObjectContext alloc] init]; [_managedObjectContext setPersistentStoreCoordinator:coordinator]; } return _managedObjectContext; }
  • 31. Saving Save occurs per context Saves changes to persistent store Should save on applicationWillTerminate: Can be reset to discard changes
  • 32. Saving - (void)saveContext { NSError *error = nil; NSManagedObjectContext *managedObjectContext = self.managedObjectContext; if (managedObjectContext != nil) { if ([managedObjectContext hasChanges] && ![managedObjectContext save:&error]) { // Replace this implementation with code to handle the error appropriately. } } }
  • 33. NSManagedObject Represents an entity in your model Superclass of managed object subclasses Access attributes via KVC/KVO and properties Pass NSManagedObjectIDs between threads Xcode can generate subclass with accessors Can be a fault
  • 34. Querying Entites NSPredicate Rich query syntax Aggregate property values Compound predicates Queries can return faulted entities based on result type Batch size
  • 35. Faults Only object ID Performance & memory Include specific properties Prefetch relationships
  • 36. Querying Entites NSManagedObjectContext *managedObjectContext = [self managedObjectContext]; NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"Event" inManagedObjectContext:managedObjectContext]; [request setEntity:entity]; NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"creationDate" ascending:NO]; NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil]; [request setSortDescriptors:sortDescriptors]; NSError *error = nil; NSMutableArray *mutableFetchResults = [[managedObjectContext executeFetchRequest:request error:&error] mutableCopy]; if (mutableFetchResults == nil) { // Handle the error. }
  • 37. Querying Entites NSManagedObjectContext *managedObjectContext = [self managedObjectContext]; NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"Event" inManagedObjectContext:managedObjectContext]; [request setEntity:entity]; NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"creationDate" ascending:NO]; NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil]; [request setSortDescriptors:sortDescriptors]; NSError *error = nil; NSMutableArray *mutableFetchResults = [[managedObjectContext executeFetchRequest:request error:&error] mutableCopy]; if (mutableFetchResults == nil) { // Handle the error. }
  • 38. Querying Entites NSManagedObjectContext *managedObjectContext = [self managedObjectContext]; NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"Event" inManagedObjectContext:managedObjectContext]; [request setEntity:entity]; NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"creationDate" ascending:NO]; NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil]; [request setSortDescriptors:sortDescriptors]; NSError *error = nil; NSMutableArray *mutableFetchResults = [[managedObjectContext executeFetchRequest:request error:&error] mutableCopy]; if (mutableFetchResults == nil) { // Handle the error. }
  • 39. Querying Entites NSManagedObjectContext *managedObjectContext = [self managedObjectContext]; NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"Event" inManagedObjectContext:managedObjectContext]; [request setEntity:entity]; NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"creationDate" ascending:NO]; NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil]; [request setSortDescriptors:sortDescriptors]; NSError *error = nil; NSMutableArray *mutableFetchResults = [[managedObjectContext executeFetchRequest:request error:&error] mutableCopy]; if (mutableFetchResults == nil) { // Handle the error. }
  • 40. Predicates NSPredicate *predicate = [NSPredicate predicateWithFormat:@"grade > %d", 7]; NSPredicate *testForTrue = [NSPredicate predicateWithFormat:@"anAttribute == YES"]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(lastName like[cd] %@) AND (birthday > %@)",         lastNameSearchString, birthdaySearchDate]; [fetchRequest setPredicate:predicate];
  • 41. Inserting Entities Insert into managed object context Entities are not yet persisted until context is saved
  • 42. Inserting Entities - (void)insertNewObject:(id)sender { NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext]; NSEntityDescription *entity = [[self.fetchedResultsController fetchRequest] entity]; NSManagedObject *newManagedObject = [NSEntityDescription insertNewObjectForEntityForName:[entity name] inManagedObjectContext:context]; // If appropriate, configure the new managed object. // Normally you should use accessor methods, but using KVC here avoids the need to add a custom class to the template. [newManagedObject setValue:[NSDate date] forKey:@"timeStamp"]; // Save the context. NSError *error = nil; if (![context save:&error]) { // Replace this implementation with code to handle the error appropriately. } }
  • 43. Inserting Entities - (void)insertNewObject:(id)sender { NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext]; NSEntityDescription *entity = [[self.fetchedResultsController fetchRequest] entity]; NSManagedObject *newManagedObject = [NSEntityDescription insertNewObjectForEntityForName:[entity name] inManagedObjectContext:context]; // If appropriate, configure the new managed object. // Normally you should use accessor methods, but using KVC here avoids the need to add a custom class to the template. [newManagedObject setValue:[NSDate date] forKey:@"timeStamp"]; // Save the context. NSError *error = nil; if (![context save:&error]) { // Replace this implementation with code to handle the error appropriately. } }
  • 44. Inserting Entities - (void)insertNewObject:(id)sender { NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext]; NSEntityDescription *entity = [[self.fetchedResultsController fetchRequest] entity]; NSManagedObject *newManagedObject = [NSEntityDescription insertNewObjectForEntityForName:[entity name] inManagedObjectContext:context]; // If appropriate, configure the new managed object. // Normally you should use accessor methods, but using KVC here avoids the need to add a custom class to the template. [newManagedObject setValue:[NSDate date] forKey:@"timeStamp"]; // Save the context. NSError *error = nil; if (![context save:&error]) { // Replace this implementation with code to handle the error appropriately. } }
  • 45. Inserting Entities - (void)insertNewObject:(id)sender { NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext]; NSEntityDescription *entity = [[self.fetchedResultsController fetchRequest] entity]; NSManagedObject *newManagedObject = [NSEntityDescription insertNewObjectForEntityForName:[entity name] inManagedObjectContext:context]; // If appropriate, configure the new managed object. // Normally you should use accessor methods, but using KVC here avoids the need to add a custom class to the template. [newManagedObject setValue:[NSDate date] forKey:@"timeStamp"]; // Save the context. NSError *error = nil; if (![context save:&error]) { // Replace this implementation with code to handle the error appropriately. } }
  • 46. Deleting Entites Entities are marked as deleted No longer returned in queries Not actually deleted until context is saved Deletes can be discarded before save by discarding or resetting the context
  • 47. Deleting Entites - (void)deleteEvent:(NSManagedObject*)event { NSManagedObjectContext *managedObjectContext = [self managedObjectContext]; NSError *error = nil; [managedObjectContext deleteObject: event]; if (![managedObjectContext save:&error]) { // Replace this implementation with code to handle the error appropriately. } }
  • 48. Updating Entities Same as insert Change properties and save context Updates can be discarded before save by discarding or resetting the context
  • 49. Migrations Schemas change Create new model version Automatic lightweight migration Manual migration Not all changes require migration Validation, default values, Objective-C class
  • 50. Concurency Types iOS 5 >= NSConfinementConcurrencyType Pre iOS 5 Concurrency NSPrivateQueueConcurrencyType Private dispatch queue NSMainQueueConcurrencyType Main Queue
  • 51. Resources Core Data Programming Guide http://developer.apple.com/library/mac/# documentation/cocoa/Conceptual/CoreData/cdProgrammingGuide.html Predicate Programming Guide http://developer.apple.com/library/mac/# documentation/Cocoa/Conceptual/Predicates/predicates.html Grand Central Dispatch (GCD) http://developer.apple.com/library/ios/# documentation/Performance/Reference/GCD_libdispatch_Ref/Reference/referen ce.html
  • 52. Resources Magical Record http://developer.apple.com/library/mac/# documentation/cocoa/Conceptual/CoreData/cdProgrammingGuide.html Multi-Context Core Data http://www.cocoanetics.com/2012/07/multi-context-coredata/ Core Data Editor http://christian-kienle.de/CoreDataEditor
  • 53. Q&A