mirror of
https://github.com/wu736139669/ASHReactNative.git
synced 2026-08-05 05:54:53 +00:00
fix bug
This commit is contained in:
@@ -3,6 +3,7 @@ platform :ios,8.0
|
|||||||
target 'ASHReactNative’ do
|
target 'ASHReactNative’ do
|
||||||
|
|
||||||
source 'https://github.com/CocoaPods/Specs.git'
|
source 'https://github.com/CocoaPods/Specs.git'
|
||||||
|
#React 用了0.42的版本,要在下面的源才有
|
||||||
source 'https://github.com/Artsy/Specs.git'
|
source 'https://github.com/Artsy/Specs.git'
|
||||||
pod 'React' =>'0.42.0'
|
pod 'React' =>'0.42.0'
|
||||||
pod 'React/Core' =>'0.42.0'
|
pod 'React/Core' =>'0.42.0'
|
||||||
|
|||||||
@@ -113,6 +113,15 @@
|
|||||||
- (void)rnView:(ASHRNView *)rnView didFailed:(NSError *)error
|
- (void)rnView:(ASHRNView *)rnView didFailed:(NSError *)error
|
||||||
{
|
{
|
||||||
[MBProgressHUD hideHUDForView:self.view animated:YES];
|
[MBProgressHUD hideHUDForView:self.view animated:YES];
|
||||||
|
MBProgressHUD* progressHUD = [[MBProgressHUD alloc] initWithFrame:self.view.bounds];
|
||||||
|
|
||||||
|
progressHUD.removeFromSuperViewOnHide = YES;
|
||||||
|
progressHUD.center = self.view.center;
|
||||||
|
progressHUD.label.text = @"加载失败";
|
||||||
|
[self.view addSubview:progressHUD];
|
||||||
|
|
||||||
|
[progressHUD showAnimated:YES];
|
||||||
|
[progressHUD hideAnimated:YES afterDelay:1.0];
|
||||||
}
|
}
|
||||||
- (void)rnViewDidRenderFinish:(ASHRNView *)rnView
|
- (void)rnViewDidRenderFinish:(ASHRNView *)rnView
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,8 +20,7 @@
|
|||||||
AFHTTPSessionManager* sessionManager = [AFHTTPSessionManager manager];
|
AFHTTPSessionManager* sessionManager = [AFHTTPSessionManager manager];
|
||||||
NSURLRequest* request = [NSURLRequest requestWithURL:[NSURL URLWithString:url]];
|
NSURLRequest* request = [NSURLRequest requestWithURL:[NSURL URLWithString:url]];
|
||||||
NSURLSessionDownloadTask* task = [sessionManager downloadTaskWithRequest:request progress:nil destination:^NSURL * _Nonnull(NSURL * _Nonnull targetPath, NSURLResponse * _Nonnull response) {
|
NSURLSessionDownloadTask* task = [sessionManager downloadTaskWithRequest:request progress:nil destination:^NSURL * _Nonnull(NSURL * _Nonnull targetPath, NSURLResponse * _Nonnull response) {
|
||||||
// return [NSURL fileURLWithPath:filePath];
|
return [NSURL fileURLWithPath:filePath];
|
||||||
return [NSURL URLWithString:filePath];
|
|
||||||
} completionHandler:^(NSURLResponse * _Nonnull response, NSURL * _Nullable filePath, NSError * _Nullable error) {
|
} completionHandler:^(NSURLResponse * _Nonnull response, NSURL * _Nullable filePath, NSError * _Nullable error) {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
if (completedBlock) {
|
if (completedBlock) {
|
||||||
|
|||||||
Reference in New Issue
Block a user