Add data attribute to table and app

Let’s say we want to add an attribute event_date, so that the iOS app takes in that date, and can send and store it in an Easy Table on Azure backend.

Azure backend side

Click on the designated table, you add the column attribute. Save it.

add_column

iOS side

Note: For ever new attribute you add, make sure you delete the old app that’s installed on your device. This is so that the existing app’s Core Data mode does not conflict with your new addition.

After you have finished your Easy Table, you use Quick Start to generate an iOS project that connects its Core Data to the Easy Table in Azure backend.

What you pull from the Easy Table depends on your NSFetchController:

  • entity
  • predicate
  • sortDescriptors

of the NSFetchController get method like so:

So we want to match the event_title attribute we added on the Azure backend.

We do so by manipulating our .xcdatamodelId file. In core data, each entity matches that of a table. Look for the TodoItem (or whatever table name you have created in Azure) entity. Click on it, and click the plus button to add it.

add_attribute_to_entity

In your iOS code, we pass the data dictionary to the Azure backend to fill in on the attribute. Thus, just make sure you put the key for “event_date”, and the value that you want to send, which in our case is NSDate.

Then, run your app. Add an entry. Go to your dashboard, and refresh the table rows. You will see your results there.

column_reflected