mirror of
https://github.com/wu736139669/ASHReactNative.git
synced 2026-08-05 05:54:53 +00:00
fix bug
This commit is contained in:
@@ -113,6 +113,15 @@
|
||||
- (void)rnView:(ASHRNView *)rnView didFailed:(NSError *)error
|
||||
{
|
||||
[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
|
||||
{
|
||||
|
||||
@@ -20,8 +20,7 @@
|
||||
AFHTTPSessionManager* sessionManager = [AFHTTPSessionManager manager];
|
||||
NSURLRequest* request = [NSURLRequest requestWithURL:[NSURL URLWithString:url]];
|
||||
NSURLSessionDownloadTask* task = [sessionManager downloadTaskWithRequest:request progress:nil destination:^NSURL * _Nonnull(NSURL * _Nonnull targetPath, NSURLResponse * _Nonnull response) {
|
||||
// return [NSURL fileURLWithPath:filePath];
|
||||
return [NSURL URLWithString:filePath];
|
||||
return [NSURL fileURLWithPath:filePath];
|
||||
} completionHandler:^(NSURLResponse * _Nonnull response, NSURL * _Nullable filePath, NSError * _Nullable error) {
|
||||
if (!error) {
|
||||
if (completedBlock) {
|
||||
|
||||
Reference in New Issue
Block a user