Comments (3)
太少信息了,添加个All Exceptions
断点看看
from applereserver.
I couldn't retrieve the whole of project since the GFW hinder me from reaching cocoapods.
So I'd got to do some own workarounds for orignal codes to get used to packets I had rounded up.
What's relieved is it worked out at last.
Here are some key codes:
-(void)loadStoreAndDevice {
self.deviceDictionary = [Device deviceDictionary];
NSString *url = @"https://reserve.cdn-apple.com/CN/zh_CN/reserve/iPhone/stores.json";
NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:[NSURL URLWithString:url] completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
//Failed
if (error) {
return;
}
NSDictionary *result = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil];
if (![result isKindOfClass:[NSDictionary class]]) {
return;
}
//Succeeded
dispatch_async(dispatch_get_main_queue(), ^{
self.storeArray = [Store objectArrayWithKeyValuesArray:result[@"stores"]];
[self.storeTableView reloadData];
});
}];
[task resume];
}
-(void)reloadAvailability {
NSString *url = [NSString stringWithFormat:@"https://reserve.cdn-apple.com/CN/zh_CN/reserve/iPhone/availability.json"];
NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:[NSURL URLWithString:url] completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
//Failed
if (error) {
return;
}
NSDictionary *result = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil];
if (![result isKindOfClass:[NSDictionary class]]) {
return;
}
result = result[self.selectedStore.storeNumber];
NSMutableDictionary *mutableResult = result.mutableCopy;
[result enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull value, BOOL * _Nonnull stop) {
if (![value isKindOfClass:[NSString class]]) {
[mutableResult removeObjectForKey:key];
} else {
if (self.onlyAvailabilityButton.state) {
if ([value isEqualToString:@"NONE"]) {
[mutableResult removeObjectForKey:key];
}
}
}
}];
result = mutableResult.copy;
//Succeeded
dispatch_async(dispatch_get_main_queue(), ^{
self.availabilityDictionary = result;
[self.availabilityTableView reloadData];
});
}];
[task resume];
}
And the compressed project which I had removed sorts of heavy burden like YTKNetwork so as to complete the functionality of remote query without cocoapods:
AppleReserver-master.zip
In any case, thanks for you artwork.
from applereserver.
@ljysdfz 👍🏻 Well done!
from applereserver.
Related Issues (20)
- 希望增加iPhone x HOT 1
- 不能监控ipx吗?
- 看了下支持ipx的代码修改,不知如何打包成app= =,能否提交新的版本,开袋即食
- 不支持Windows平台? HOT 1
- app启动后弹出错误警告框 HOT 1
- 能兼容下Big Sur吗
- 请求支持iPhone 12系列 HOT 4
- iphone12
- 请问具体怎么使用? HOT 1
- 求增加澳门两个门店信息 HOT 2
- 1
- 请求增加福州门店信息,谢谢
- 请求加入多门店监控和兼容iPhone 12 Pro Max/Mini HOT 8
- 怎么运行啊 HOT 2
- 5.0的包没办法运行 HOT 1
- make failed HOT 7
- 能增加澳门、香港的预约吗? HOT 2
- 红绿图标 HOT 1
- 执行命令崩溃 HOT 1
- 请问如何使用? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from applereserver.