English 中文(简体)
如何在目标c中恢复数据下载?
原标题:How to resume data download in objective c?
  • 时间:2012-04-04 12:03:38
  •  标签:
  • core-data

我正在下载一些数据和互联网连接线,在核心数据模型中从目前状态下载吗?

问题回答

核心数据模型和下载之间没有任何关系。 你们必须区分这些步骤:

  1. Make a download request.
  2. The download ends with success or error.
  3. Handle the data - e.g. store it in core data.
    • if finished successfully, you are done
    • if not continue
  4. Notice that you can download again.
  5. Form a new download request, requesting only the missing data from the server
  6. Go to step 2.

Step 1 will be handled with a NSURLRequest.
Step 2 can be caught in the NSURLConnection delegate methods.
Step 3 is should be routine if you were successful. If not, you would have to analyze your data object to see what you can salvage and save.
Step 4 can be accomplished with the Reachability class. Check Apple s sample code.
Step 5 requires that your server can handle the selective data requests.

单一步骤有许多细节。 排流的最佳召集,并查阅文件,以规范各个步骤。 我希望这一计划有助于你解脱。





相关问题
iPhone Core Data Recursive Relationships

I m having some trouble with a recursive relationship in core data. I ve got a managed object called a "SearchCategory", and that category can have "Categories" and it can also have a "Category." In ...

Plist Hierarchy and All Option

I have a string of data in a plist, which I ve got to display, hierarchically like this: Menu>Chapter>SubChapter>item>item details This might be super simple, in my initial menu, how would I have ...

Fetched Properties v Relationships (Core Data - iPhone)

I m a new iPhone developer (of about 4 months or so) who is starting to look at Core Data. In the "Beginning iPhone 3 Development" book by Dave Mark it mentions that the main difference between ...

Cocoa Core Data newbie how-tos

I am one of the great unwashed masses of .NET developers keen to try their hands at Mac OS X development. At the moment I am trying to figure out the various elements of Cocoa and getting a bit stuck ...

中间储存的核心数据

我想将核心数据作为输入数据库服务器更大数据集的切身。

Limit the returned resultset in CoreData

In CoreData, if I want to limit the returned resultset to 100, is it enough to just set the fetch limit to 100, or do I need to set the fetch batch size to 100 as well?

热门标签