讓我們舉一個例子..用於Nethfel用戶;點擊他的播放列表;在鏈接欄,你會看到「http://www.youtube.com/watch?v=4nx7g60Ldig &列表= UUANsW00CkQnNnnUyuC1cygw」
現在..我們採取的播放列表「數量」 UUANsW00CkQnNnnUyuC1cygw
和..我們將盡一個JSON request..max 50個結果
您可以JSONC替代JSON - 你會本身在搜索結果中的微小變化; 這將是你在你的應用程序開始時要求
現在,我們必須「解釋/翻譯」下一個結果:
{
apiVersion: "2.1",
data: {
id: "UUANsW00CkQnNnnUyuC1cygw",
author: "Nethfel",
title: "Uploaded videos",
description: "",
thumbnail: {
sqDefault: "http://i.ytimg.com/vi/4nx7g60Ldig/default.jpg",
hqDefault: "http://i.ytimg.com/vi/4nx7g60Ldig/hqdefault.jpg"
},
content: {
5: "http://www.youtube.com/p/UUANsW00CkQnNnnUyuC1cygw"
},
totalItems: 17,
startIndex: 1,
itemsPerPage: 50,
items: [
{
id: "UUGCa8nZNU7uOfDF3zV9AxkJtJSuX5gHGI",
position: 1,
author: "Nethfel",
video: {
id: "4nx7g60Ldig",
uploaded: "2011-11-02T12:32:03.000Z",
updated: "2013-01-07T18:26:41.000Z",
uploader: "nethfel",
category: "Howto",
title: "iOS Passing Data Between View Controllers Technique 1",
description: "This video discusses one of the most basic techniques for passing data between view controllers in an iOS application. This technique uses storing a local iVar in one class and passing it to the second class about to be displayed on the screen. Although this is a very simple example using an NSString, it can be applied using any other type of data as well - whether it be a collection or a custom data model object.",
thumbnail: {
sqDefault: "http://i.ytimg.com/vi/4nx7g60Ldig/default.jpg",
......
你把所有的元素:標題,縮略圖,網頁鏈接等... 你需要解析(提取物)這個JSON響應..把它放在一個TableView中..
在單擊單元格,打開一個新的「詳細信息」頁面..是你可以有LBYouTubeView for iOS
預測來自H2CO4(或whateve)的響應他被稱爲)。這與Xcode無關。 – Fogmeister