Question on Database connectivity

Could someone answer a newbee question. I have watched several Lyda.com classes. ie: "Swift Essential training", "IOS App development" and I have read the book "Learn IOS App development 2nd edition - Apress". I feel I'm starting to get a pretty good understanding of the language and IDE. What I'm hopeing to do next is learn/understand how to save data to the phone and then how to connect to a MS SQL Database and write/update/delete etc. If you haven't guess it, I

am hoping to create business apps.


Questions:

1. Would I use something SQLite to save data temporarily to the phone. (Is that what it's for?)

If yes { what would you suggest I read / google to learn about the technology }

else { would you have a better suggestions }


2. I would like to have the functionality to connect to a MS Sql database and INSERT,

UPDATE records. Is that done through "Core Data". Is Core Data an api to connect to db's.

If yes { any suggestions for a good book or web site to learn this technology }


Here is my goal!

I have created .Net database web applications and I would like to create a companion IOS app for users to create

records for submission to the database. I would like them to be able to save the data to the phone when no internet

write the records.


Thanks


Dave.

Answered by OOPer in 64013022

YES for 1. SQLite3 library is included in iOS SDK, and you can find many articles on `SQLite3 in iOS`.

But consider adopting CoreData for your purpose. It has a logical interface based on ER and comes with graphical ER scheme designer, and easily upgradable to work with iCloud. Especially, you can find many resources in this official developer site.


NO for 2. As noted above, CoreData is not a general database connectivity.

Nowadays, connecting client devices directly to database server is considered to be outdated, so it is very hard to find other alternatives if you intend it.


As .NET MVC WebAPI is one of the easiest ways to provide APIs for iOS clients (though this is not a good place to discuss it), you may easily extend your .Net web application to provide RESTful APIs for iOS clients. And iOS apps can easily commucate with such APIs using its HTTP(S) supported communication functionalities.

Networking Overview is a good starting point to learn about client side communications feature in iOS.

(Though it contains some descriptions about legacy technologies, not recommended to use with your newly developed apps.)

NSURLSession and related classes would be the key tech for client side programming.

Accepted Answer

YES for 1. SQLite3 library is included in iOS SDK, and you can find many articles on `SQLite3 in iOS`.

But consider adopting CoreData for your purpose. It has a logical interface based on ER and comes with graphical ER scheme designer, and easily upgradable to work with iCloud. Especially, you can find many resources in this official developer site.


NO for 2. As noted above, CoreData is not a general database connectivity.

Nowadays, connecting client devices directly to database server is considered to be outdated, so it is very hard to find other alternatives if you intend it.


As .NET MVC WebAPI is one of the easiest ways to provide APIs for iOS clients (though this is not a good place to discuss it), you may easily extend your .Net web application to provide RESTful APIs for iOS clients. And iOS apps can easily commucate with such APIs using its HTTP(S) supported communication functionalities.

Networking Overview is a good starting point to learn about client side communications feature in iOS.

(Though it contains some descriptions about legacy technologies, not recommended to use with your newly developed apps.)

NSURLSession and related classes would be the key tech for client side programming.

OOPer: Thank you very much for the information. That is exactly what I needed to know.


Dave

OOper:


Just so I understand this correctly are SQLite and CORE DATA two different technologies? I was under the impression that a SQLite database is created in your app when you create a core data app, and that you use the core data api to access it?


One last question. I am current with my version of Xcode and swift. I have tought myself Swift with the understanding that Swift is the newest and most improved language (the future of IOS developement) is that correct. Should I not worry about Objective-C. Has Objective-C been depricated for Swift?

Also, I have struggled to find information on learning SQLite or Core Data with swift and xcode 7. Would you have any suggestions for books etc to learn this stuff. How do people learn this stuff. Do most people just use the Apple tutorials and docmentation.


Sorry if I'm sounding like I'm scrambling/clawing for knowledge. I am 🙂


Dave.

Objective-C is definitely NOT depricated. It will be around for a long time (possibly indefinitely). There are still some things you can do in Objective-C that aren't available in Swift (SQLite may be one of them). Objective-C is much more stable and mature at this point.

Question on Database connectivity
 
 
Q