ORM-like feature on iOS [closed] - ios

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I was wondering if there was a framework of some kind that enable us to create classes that will mainly fetch data from an API to populate itself.
I was looking at core data, but I don't think core data is what I'm looking for since it aims to persist data inside the app.
In case I wasn't clear enough, I want an easy way to do this:
#interface MyUser{
NSUInteger id; // user id form the database
NSString *first_name;
NSString *last_name;
...
}
#end
Is there anything inside(or outside) iOS that would help me with that, or I'll just have to fetch a JSON and populate it myself?

I wouldn't bother using any framework, you'll struggle to find one that suits your needs exactly.
Better to roll your own system, it's pretty simple.
Make a subclass of NSObject, give it an NSMutableDictionary or NSCache object to store data fetched from the remote server.
Implement -resolveInstanceMethod: to read/write to the data in the dictionary/cache/remote server.
There's a good example here showing roughly what you want: https://github.com/davedelong/Demos/blob/master/DynamicStorage/DynamicStorage/DDDynamicStorageObject.m follow through that code, read the documentation for anything you don't understand. It's fairly simple stuff once you get your head around it.

Related

How can I get data from a website to ios app [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I want to create an iOS app that can show the bike stations and their availability(how many bikes are available in each station) from a website and I want to know how can I do it (which request?...)
There are plenty of ways you can do that.
First you should investigate if the BIKE Data Website offers a Web Service that you can utilize ? I suspect not. Then you create your Own Web service (I think it will be ideal to create REST - http/JSON) type service since that is lighter in comparison to the SOAP.
In your Service You will need to do a HTTP Request on the URL where the data is, html will be returned from the page, then look through the html and parse and get the data you need and return values to your app.
I hope this provides a pointer.
Thanks

How do i implement a database for my ios app? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Improve this question
So i created my first app which allows users to track there fitness information (workouts, routines, etc). I want take my app to the next step by allowing the user to create there own account and be able to access their workouts from any ios device (all they have to do is log in). I know i have to use databases, but I just don't know where or how to start this process.
Could you recommend any tutorials or perhaps a resource you used to teach yourself? I'm familiar with sql (took a course on it in university.
thanks guys, I apologize for the newb question.
There are many third-party services you can use that can take care of the backend for your app so that you don't need to worry about managing the database yourself. Two of the most popular ones are parse and stackmob. Take a look at their documentations. I personally use parse and would recommend it.
I've never written any os apps, but for applications in general.
There are many ways, one of which is getting a server/website (you can get free ones) and set up the MYSQL database to have the tables you need like users etc.
Then simply send requests via POST/GET to the server which will enter it into the database.Then when they want to login just do the reverse.
I would personally uses sockets, and probably encrypt the data. You may as-well send information such as how long they've used the app for etc.

Are there alternatives to Parse.com for iOS? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I currently use parse.com to manage users. They have a great API, decent backend for me to manage stuff. But I'd prefer to host my own data.
The server backend, I could whip that up in php very easily. But I'm struggling to find a decent library/framework on the iOS side of things to replicate what Parse's framework does.
To do things like easy login/logout, having a user 'cached' with a saved file, easy to use methods for using blocks to send data in the background. Any clues as to where to look or what to search for to find a similar open source library that I can integrate with my own systems?

how to save taken images to use as background images? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
In my application, you can take photos or choose photos from the library in order to use them as a background image later.
I would like to ask for a tutorial that explains how to save these photos using Core Data.
Sorry if this question is not appropriate, I know that StackOverflow is only for code questions. And sorry for my bad English, I am Spanish.
Thank you!
Here this is a nice tutorial. It teaches you how to use core data over all but it also teaches with pictures. By the way you need to create a new attribute with the type binary data to save the photo. Basically you need to convert your image into NSData and then save it in your attribute. To get it out convert NSData to a UIImage.

Developing RESTful clients on iOS [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I am building an app on iOS and on Mac OS X that talks to a server using REST. The app is expected to store data fetched from the server in a local store (preferably in a SQLlite database). I understand using Core Data is a good option, but I am looking for an example of an app architecture that works on the basis of UI Views getting notified when the SQLlite database is updated as a result of a response from the server.
I have seen a talk for Android at Google I/O that addresses this type architecture in detail. Are there any similar talks/articles like this for iOS?
You're mixing quite some different things here.First you need an interface for your restufl API. Look at AFNetworking library to handle requests to the server and build your API handler. Then use an NSFetchResultController to listen to your core data being updated and do what you need accordingly in your views. NSFetchResultController is built to be used with a UITableView but you can use it in other situations if needed.
use RestKit it's the best framework to work with Rest services.
and it's well-documented. the latest version works on top of AFNetworking.
you can find some examples there as well.

Resources