iPhone and iPad development
658.7K views | +0 today
Follow
iPhone and iPad development
Tips, Libs and more about iPhone and iPad development and ios
Curated by Vincent Demay
Your new post is loading...
Scooped by Vincent Demay
Scoop.it!

» Core Data in iCloud Tim Roadley

» Core Data in iCloud Tim Roadley | iPhone and iPad development | Scoop.it

The aim of this tutorial is to show how to add iCloud support to a project. The starting point will be the final project from the end of the Core Data Universal / iPad Storyboard tutorial. I would recommend going through that tutorial first so you’re familiar with the Staff Manager project.


No comment yet.
Scooped by Vincent Demay
Scoop.it!

Temporary Storage In Apple’s CoreData

Temporary Storage In Apple’s CoreData | iPhone and iPad development | Scoop.it

"Whilst CoreData is good, it can take a while for developers to get to grips with this new approach to data storage. One thing I see time and time again is the question of how to handle temporary data. One argument is that core data should only be used for the persistent data store and that any operations above this level should use other domain level objects; only mapping to a NSManagedObject model once you know you wish to persist. The second argument is that you should limit the number of duplicate domain level objects you have and utilise CoreData for the storage and handling of both temporary and persistent objects."

No comment yet.
Scooped by Vincent Demay
Scoop.it!

Tutorial: Storyboard app with Core Data | MaybeLost.com

Tutorial: Storyboard app with Core Data | MaybeLost.com | iPhone and iPad development | Scoop.it

The application we will be making will be fairly simple. We will start with an empty project and design our core data layout (including some default data) which will be used in the main application and a login page. On successful login we will then display a table with a bunch of entries and associated thumbnails. We will include the ability to add and delete entries, and to use the camera to take the photo for each entry (or choose from an album). Here’s a shot of the screen flow for the application when finished….

No comment yet.
Scooped by Vincent Demay
Scoop.it!

ActiveRecord Fetching for Core Data

In software engineering, the active record pattern is a design pattern found in software that stores its data in relational databases. It was named by Martin Fowler in his book Patterns of Enterprise Application Architecture. The interface to such an object would include functions such as Insert, Update, and Delete, plus properties that correspond more-or-less directly to the columns in the underlying database table.



"Active record is an approach to accessing data in a database. A database table or view is wrapped into a class; thus an object instance is tied to a single row in the table. After creation of an object, a new row is added to the table upon save. Any object loaded gets its information from the database; when an object is updated, the corresponding row in the table is also updated. The wrapper class implements accessor methods or properties for each column in the table or view."

Wikipedia

âś” Sources: https://github.com/brunogb/MagicalRecord

No comment yet.
Scooped by Vincent Demay
Scoop.it!

Simple Sqlite Database Interaction Using FMDB

Simple Sqlite Database Interaction Using FMDB | iPhone and iPad development | Scoop.it

Introduction

In the age where Core Data is king, the database that started it all is often overlooked. I’m talking of course about sqlite. As you may or may not know, prior to core data, sqlite was the preferred method of storing relational data on iOS devices.


FMDB

FMDB stands for Flying Meat Database. What a great name… This project aims to be a fully featured wrapper for sqlite.

âś” Sources:  https://github.com/ccgus/fmdb

No comment yet.
Scooped by Vincent Demay
Scoop.it!

Autosaving Core Data managed object context

Autosaving Core Data managed object context | iPhone and iPad development | Scoop.it

"This has nothing to do with Lion autosaving. It has everything to do with the fact that Apple’s template for Core Data saves the managed object context only at exit.


I’m proposing the following solution. Note that while you’re at it, you may want to move most of Core Data related code that Apple’s “shoebox” Core Data template puts in the AppDelegate. Put it in a singleton class called Database.


Expose +sharedDatabase, and #define DB [Database sharedDatabase] in the header. This was somewhat unrelated, but it’s worth mentioning."

No comment yet.
Scooped by Vincent Demay
Scoop.it!

iPhone App Development Tutorial – Core Data part 2 – One to Many Relationship

iPhone App Development Tutorial – Core Data part 2 – One to Many Relationship | iPhone and iPad development | Scoop.it

"In this tutorial we will look at creating a one to many relationship in core data. It’s really very easy and not that much different than creating the one to one relationship. The difference comes in how the relationship allows the entities to interact with each other. In part one we had two entities, Fruit and Source. These two entities had a one to one relationship to each other. For each Fruit there was only one Source, and the inverse was true as well, for each Source there was only one Fruit. Now we are going to create two new entities, Artist and Album. Each artist can have multiple albums, but each album can have only one artist. "


No comment yet.
Scooped by Vincent Demay
Scoop.it!

Adoption Curve » Blog Archive » Unit testing Core Data

Core Data Unit Test by Tim


"The project I’m working on at the moment is Core Data-based, and I’m (attempting) to built it using a test-driven approach. In practice, there’s at least as much development-driven testing as there is test-driven development, but I’m using the fact that I’m on a learning curve as my get-out-of-jail-free card."

No comment yet.
Scooped by Vincent Demay
Scoop.it!

Core Data Migrations

Core Data Migrations | iPhone and iPad development | Scoop.it

"Migrating the core data schema on an iOS app is like a monster in a cave. When I walk by, the monster growls and I back off


Well not today. Today I learned to do a simple migration in an existing core data app and I confirmed what so many others had said.

  • It’s strangely easy to do migrations… once you know how.

Unfortunately I never found anyone that would explain it, so that’s what I’m doing her"

No comment yet.
Scooped by Vincent Demay
Scoop.it!

Sunetos, Inc. :: How To Use Custom Classes With Core Data Without Fear

Sunetos, Inc. :: How To Use Custom Classes With Core Data Without Fear | iPhone and iPad development | Scoop.it

If you are using CoreData in your iOS app, you have several options for your domain objects. Here is a short list of ways you could use Core Data objects in your app:

 1 - Use generic NSManagedObject, no custom classes

 2 - Create custom classes by hand

 3 - Create a file template to use when creating custom classes

 4 - Use an external tool to create custom classes

 5 - Let Xcode generated custom classes, then modify them

 6 - Add categories to Xcode generated custom classes

 

No comment yet.
Scooped by Vincent Demay
Scoop.it!

Importing and displaying large data sets in Core Data

Importing a large amount of data, either from disk or from a network takes time and memory. If this is done on the main/UI thread then it becomes obvious to the user because the user interface is slow or unresponsive. This leads to a poor experience for the user.

On the other side of this, once you get the data imported into Core Data then you need to save it. If you are using a SQLite database then it can take a considerable amount of time. If you are using a binary store then it will take even longer. Again a poor user experience.

The answer to this problem involves multi-threading and breaking the job down into smaller pieces.

No comment yet.
Scooped by Vincent Demay
Scoop.it!

Transient Entities and Core Data

Core Data has many features, one of which is the Transient attribute. This type of attribute on a Core Data entity is part of a data model, but is not persisted in your Core Data persistent store. If you open up the raw SQLite store file and peek at the schema, you will not find any transient attributes. These transient attributes are still handy despite no data being persisted to the data store. One useful scenario is when a value is calculated based on other attributes. This calculation can be performed in an entity’s awakeFromFetch method, and stored at run time in this transient attribute.

No comment yet.
Curated by Vincent Demay
Development Manager @ Scoop.it - http://www.scoop.it
iPad, iPhone and Android developer
Geek :)