Skip to main content

Posts

Showing posts with the label core data

Making an iOS app like making a Java web app - Part 2: writing iOS apps

In part 1 , I gave a brief, very high level overview on how Java web apps are written. Ok how about a quick recap of what was covered in part 1...actually let's use some diagrams this time. Previously ... in Part 1 Java web app architecture The above diagram essentially summarises what was written in the section titled " Java web app walkthrough", so in a nutshell For a Java web app, the user interface (UI) is created via HTML/CSS/Javascript The Controllers i.e. Java code act as a communication layer between the UI and the Data store, typically a Database: what that means is that the Java code passes data to and from the UI and the Data Store(Database). The kind of Data Store that I normally work with is a  relational database , there is a reason I have mentioned the type of database, read on to find out why. Refer to Part 1 for a more detailed walkthrough of a real-world example of using a registration form Now how can we apply the above approach to w...

My app crashes when I add a new entity to the core data model in my iOSapp

Ok so I was looking for a way to store data to persistent storage in my app. Since I am building an HTML5 app, my first solution was to store data using the now deprecated WebSql database ( indexedDB was only introduced in iOS 8!).  Now i had the basic data storage going and then I realised some of the storage limitations in the WebSql database, so I began searching for another solution and during that search I met  Core Data !! It was almost like love at first sight, it had all the storage awesomeness that I was after. Since there was so much love, I just wanted to build something and see how it works. So I followed an online tutorial rather than reading Apple's documentation on it, what I did was,  I added an entity to my core data model and wrote the logic to store data and it was all working! So now my app could store and retrieve data from a persistent data source without the storage limitation imposed by WebSql in a webView. It was all going great and thanks...