iOS: fix when blend subnode,occured crash
This commit is contained in:
parent
8ef9ddc610
commit
46609aee4c
@ -76,7 +76,8 @@ - (void)recursiveMixin:(NSDictionary *)srcModel to:(NSMutableDictionary *)target
|
|||||||
if (subviews) {
|
if (subviews) {
|
||||||
for (NSDictionary *subview in subviews) {
|
for (NSDictionary *subview in subviews) {
|
||||||
NSString *viewId = subview[@"id"];
|
NSString *viewId = subview[@"id"];
|
||||||
[targetOri enumerateObjectsUsingBlock:^(NSDictionary *obj, NSUInteger idx, BOOL *stop) {
|
NSMutableArray *mutableTargetOri = [targetProp[@"subviews"] mutableCopy];
|
||||||
|
[mutableTargetOri enumerateObjectsUsingBlock:^(NSDictionary *obj, NSUInteger idx, BOOL *stop) {
|
||||||
if ([viewId isEqualToString:obj[@"id"]]) {
|
if ([viewId isEqualToString:obj[@"id"]]) {
|
||||||
NSMutableDictionary *mutableDictionary = [obj mutableCopy];
|
NSMutableDictionary *mutableDictionary = [obj mutableCopy];
|
||||||
[self recursiveMixin:subview to:mutableDictionary];
|
[self recursiveMixin:subview to:mutableDictionary];
|
||||||
@ -131,17 +132,17 @@ - (DoricViewNode *)subNodeWithViewId:(NSString *)viewId {
|
|||||||
|
|
||||||
- (NSArray *)getSubNodeViewIds {
|
- (NSArray *)getSubNodeViewIds {
|
||||||
NSMutableArray *discardedItems = [NSMutableArray array];
|
NSMutableArray *discardedItems = [NSMutableArray array];
|
||||||
|
|
||||||
NSMutableArray *allKeys = [[NSMutableArray alloc]init];
|
NSMutableArray *allKeys = [[NSMutableArray alloc] init];
|
||||||
allKeys = [NSMutableArray arrayWithArray:[self.subNodes allKeys]];
|
allKeys = [NSMutableArray arrayWithArray:[self.subNodes allKeys]];
|
||||||
for (NSString *key in allKeys) {
|
for (NSString *key in allKeys) {
|
||||||
if ([self subNodeWithViewId:key] == nil) {
|
if ([self subNodeWithViewId:key] == nil) {
|
||||||
[discardedItems addObject:key];
|
[discardedItems addObject:key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[allKeys removeObjectsInArray:discardedItems];
|
[allKeys removeObjectsInArray:discardedItems];
|
||||||
|
|
||||||
return allKeys;
|
return allKeys;
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
Reference in New Issue
Block a user