Skip to content

Commit aa4ef9c

Browse files
author
zhenglibao
committed
优化在线加载资源
1 parent 40a2889 commit aa4ef9c

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
**FlexLib**的所有版本的变更日志都将会在这里记录.
33

44
---
5+
## 2.3.6
6+
1.优化在线加载资源,在加载失败情况下自动使用本地资源
7+
58
## 2.3.5
69
1.优化缓存目录
710

FlexLib.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'FlexLib'
11-
s.version = '2.3.5'
11+
s.version = '2.3.6'
1212
s.summary = 'An obj-c flex layout framework for IOS'
1313

1414
# This description is used to generate tags and improve search results.

FlexLib/Classes/FlexNode.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,15 @@ void FlexSetPreviewBaseUrl(NSString* filexName)
848848
if(error != nil){
849849
NSLog(@"Flexbox: loadFromNetwork error: %@",error);
850850
}
851+
852+
// check http result valid
853+
error = nil;
854+
GDataXMLDocument* xmlDoc = [[GDataXMLDocument alloc]initWithData:flexData options:0 error:&error];
855+
if (error!=nil) {
856+
NSLog(@"Flexbox: the online data for %@ not valid, local xml resource used.(%lld)",resName,(SInt64)xmlDoc);
857+
858+
flexData = loadFromFile(resName, owner);
859+
}
851860
return flexData;
852861
}
853862

0 commit comments

Comments
 (0)