我应该将核心数据与REST API后端一起使用吗? [英] Should I Use Core Data With A REST API Backend?

查看:277
本文介绍了我应该将核心数据与REST API后端一起使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对核心数据的确切用途有些困惑.我在Google上搜索了很多,关于核心数据的很多帖子都关于使用Core Data进行本地存储.目前,我正在开发具有REST API后端的应用程序,并且使用AFNetworking发送/接收对REST API的响应.

I am a little confused on what core data is exactly used for. I have googled a lot on it, and a lot of posts on core data are about using Core Data for local storage. At the moment I am developing an app with a REST API backend, and I use AFNetworking to send/receive responses to the REST API.

我想知道的是,我是否应该使用Core Data与REST API通信?核心数据能够做到这一点吗?最好使用Core Data还是使用AFNetworking?

What I am wondering is if I should instead use Core Data to communicate with the REST API? Is Core Data able to do such a thing? Would it be best to use Core Data or to use AFNetworking?

推荐答案

不,核心数据不用于与后端(或其他任何东西)进行通信.如您所说,它用于本地存储.就是这样.

No, core data is not used to communicate with a back-end (or anything else). As you said, it is for local storage. That's it.

要与Web服务或其他Internet API进行通信,请使用多种工具之一来完成工作,例如NSURLConnection或AFNetworking.

To communicate with a web service or other Internet API, use one of various tools for the job such as NSURLConnection or AFNetworking.

这篇关于我应该将核心数据与REST API后端一起使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆