仿百思不得姐 社群

2021-09-23 08:11:07 字數 2122 閱讀 5951

1. 獲取資料:通過charles擷取當tabbar切換到「社群」時,傳送get請求獲取資料

經過分析,只需要 url 和 image 建立模型類

@inte***ce gypromotionitem : nsobject

@property (strong, nonatomic) nsstring* url;

@property (strong, nonatomic) nsstring* image;

@end

新增模型陣列

@inte***ce gynewviewcontroller ()

@property (strong, nonatomic) nsarray*promotions;

@end

用afn獲取資料,並且解析得到gypromotionitem模型陣列:

- (void)loadpromotiondata  failure:^(nsurlsessiondatatask * _nullable task, nserror * _nonnull error) ];

}

<2> 獲取訂閱資料:瀏覽器中輸入**: 得到 json資料。

這裡可以看到這是乙個模型陣列。

@inte***ce gysubscribeitem : nsobject

@property (strong, nonatomic) nsstring* theme_name;

@property (strong, nonatomic) nsstring* image_detail;

@property (strong, nonatomic) nsstring* info;

@property (strong, nonatomic) nsstring* image_list;

@end

新增模型陣列

@inte***ce gynewviewcontroller ()

@property (strong, nonatomic) nsarray*promotions;

@property (strong, nonatomic) nsarray*subscribes;

@end

解析資料

這是乙個模型陣列。

@inte***ce gyhotsearchitem : nsobject

@property (assign, nonatomic) nsinteger count;

@property (strong, nonatomic) nsstring* name;

@end

新增模型陣列

@property (strong, nonatomic) nsarray*promotions;

@property (strong, nonatomic) nsarray*subscribes;

@property (strong, nonatomic) nsarray*hotsearches;

解析資料

- (void)loadhotsearchdata  failure:^(nsurlsessiondatatask * _nullable task, nserror * _nonnull error) ];

}

顯示數

百思不得解!

此處專門用來收集一些問題 1.問題背景 記憶體對映檔案的優點在於可以保密檔案。可以減少i o操作。但檔案過大的話並不推薦使用。例如,我的程式要引用乙個叫a.exe的程式,而a.exe是別人寫的我沒有原始碼,但我引用該exe時又不希望別人獲得這個exe,只希望別人在我的程式中使用a.exe的功能。此時...

百思不得姐資料重新整理資料部分 七

1 重新整理功能圖 2 內部計算原理圖 1 分析整個精華模組 2 真實資料請求部分 3 模型 4 先新增尾部重新整理控制項 5 再新增頭部重新整理控制項 6 處理重新整理業務邏輯 7 知識點補充1 大致步驟 1 檢視百思不得姐該部分的介面文件,獲取url.2 檢視介面文件中哪些是需要的請求引數 在百...

Python3抓取糗百 不得姐

重要提示1 本文所列程式均基於python3.6,低於python3.6的python版本可能無法執行.重要提示2 因所抓取的 可能隨時更改展示內容,因此程式也需及時跟進.重要提示3 本程式僅供學習,不能拿去做壞事.1.安裝python 3.6 2.安裝以下庫 整個程式,按照下面的步驟 上述部分體現...