Guest User

Untitled

a guest
Jul 12th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. NSMutableArray *changeSubtree(NSMutableArray *result)
  2. {
  3.  
  4.  
  5.  
  6.   if ([result count] == 3) {
  7.     for(int k = 0; k < 3; k++) {
  8.  
  9.  
  10.       id myobject = [result objectAtIndex:k];
  11.  
  12.       if ([myobject isKindOfClass: [UIKBTree class]]) {
  13.  
  14.  
  15.     UIKBTree *mykbtree = (UIKBTree *)myobject;
  16.  
  17.  
  18.  
  19.  
  20.     UIKBTree *new_mykbtree = [[UIKBTree alloc] init];
  21.     new_mykbtree = [mykbtree copy];
  22.  
  23.     mykbtree = new_mykbtree;
  24.  
  25.     NSMutableArray *resultz = [[NSMutableArray alloc] initWithArray:mykbtree.subtrees];
  26.     mykbtree.subtrees = resultz;
  27.  
  28.  
  29.  
  30.  
  31.     NSMutableArray *resultx = mykbtree.subtrees;
  32.  
  33.  
  34.     if([resultx count] == 3){
  35.  
  36.       UIKBTree *mykbtree_r1 = [resultx objectAtIndex:0];
  37.  
  38.       NSMutableArray *resulty = [[NSMutableArray alloc] initWithArray:mykbtree_r1.subtrees];
  39.  
  40.       mykbtree_r1.subtrees = resulty;
  41.       id myobject1 = [mykbtree_r1.subtrees objectAtIndex:0];
  42.  
  43.       if([mykbtree_r1.subtrees count] == 11){
  44.  
  45.         if ([myobject1 isKindOfClass: [UIKBShape class]]) {
  46.  
  47.           [resulty addObject: [[resulty objectAtIndex:0] copy]];
  48.           [resulty addObject: [[resulty objectAtIndex:1] copy]];
  49.           [resulty addObject: [[resulty objectAtIndex:2] copy]];
  50.           [resulty addObject: [[resulty objectAtIndex:3] copy]];
  51.           [resulty addObject: [[resulty objectAtIndex:4] copy]];
  52.           [resulty addObject: [[resulty objectAtIndex:5] copy]];
  53.           [resulty addObject: [[resulty objectAtIndex:6] copy]];
  54.           [resulty addObject: [[resulty objectAtIndex:7] copy]];
  55.           [resulty addObject: [[resulty objectAtIndex:8] copy]];
  56.           [resulty addObject: [[resulty objectAtIndex:9] copy]];
  57.           [resulty addObject: [[resulty objectAtIndex:10] copy]];
  58.  
  59.           [resulty addObject: [[resulty objectAtIndex:10] copy]];
  60.  
  61.  
  62.           for(int i = 11; i < 23; i++) {
  63.         id myobject2 = [resulty objectAtIndex:i];
  64.  
  65.  
  66.         if ([myobject2 isKindOfClass: [UIKBShape class]]) {
  67.           UIKBShape *myshape = (UIKBShape *)myobject2;
  68.  
  69.  
  70.           CGRect rect;
  71.           if(layout != nil && (layout.orientation == 3 || layout.orientation == 4)) {
  72.  
  73.             if(i == 22)
  74.               rect=CGRectMake(890, 68, 73, 62);
  75.             else
  76.               rect=CGRectMake(myshape.frame.origin.x, 68, 73, 62);
  77.           } else {
  78.             if(i == 22)
  79.               rect=CGRectMake(671, 52, 55, 50);
  80.             else
  81.               rect=CGRectMake(myshape.frame.origin.x, 52, 55, 50);
  82.  
  83.           }
  84.  
  85.           myshape.frame = rect;
  86.           myshape.paddedFrame = rect;
  87.  
  88.         }
  89.           }
  90.  
  91.  
  92.           for(int i = 0; i < 11; i++) {
  93.         id myobject2 = [resulty objectAtIndex:i];
  94.         if ([myobject2 isKindOfClass: [UIKBShape class]]) {
  95.           UIKBShape *myshape = (UIKBShape *)myobject2;
  96.  
  97.           CGRect rect;
  98.  
  99.           if(layout != nil && (layout.orientation == 3 || layout.orientation == 4)) {
  100.             rect=CGRectMake(myshape.frame.origin.x, 5, 73, 61);
  101.           } else {
  102.             rect=CGRectMake(myshape.frame.origin.x, 3, 55, 50);
  103.           }
  104.  
  105.           myshape.paddedFrame = rect;
  106.         }
  107.           }
  108.         }
  109.       }
  110.  
  111.  
  112.       UIKBTree *mykbtree_r2 = [resultx objectAtIndex:1];
  113.  
  114.       resulty = [[NSMutableArray alloc] initWithArray:mykbtree_r2.subtrees];
  115.  
  116.       mykbtree_r2.subtrees = resulty;
  117.  
  118.       if([mykbtree_r2.subtrees count] == 11){
  119.  
  120.  
  121.         for(int i = 0; i < 11; i++) {
  122.           id myobject2 = [resulty objectAtIndex:i];
  123.           if ([myobject2 isKindOfClass: [UIKBShape class]]) {
  124.         UIKBShape *myshape = (UIKBShape *)myobject2;
  125.  
  126.         CGRect rect;
  127.         if(layout != nil && (layout.orientation == 3 || layout.orientation == 4))
  128.           rect=CGRectMake(myshape.frame.origin.x, 136, 73, 63);
  129.         else
  130.           rect=CGRectMake(myshape.frame.origin.x, 101, 55, 50);
  131.  
  132.         myshape.paddedFrame = rect;
  133.           }
  134.         }
  135.       }
  136.  
  137.  
  138.  
  139.  
  140.  
  141.       UIKBTree *mykbtree_r3 = [resultx objectAtIndex:2];
  142.  
  143.  
  144.       resulty = [[NSMutableArray alloc] initWithArray:mykbtree_r3.subtrees];
  145.  
  146.       mykbtree_r3.subtrees = resulty;
  147.  
  148.       if([mykbtree_r3.subtrees count] == 10){
  149.  
  150.         for(int i = 0; i < 10; i++) {
  151.           id myobject2 = [resulty objectAtIndex:i];
  152.           if ([myobject2 isKindOfClass: [UIKBShape class]]) {
  153.         UIKBShape *myshape = (UIKBShape *)myobject2;
  154.  
  155.         CGRect rect;
  156.         if(layout != nil && (layout.orientation == 3 || layout.orientation == 4))
  157.           rect=CGRectMake(myshape.frame.origin.x, 204, 73, 62);
  158.         else
  159.           rect=CGRectMake(myshape.frame.origin.x, 150, 55, 50);
  160.  
  161.         myshape.paddedFrame = rect;
  162.           }
  163.         }
  164.       }
  165.  
  166.     }
  167.       }
  168.  
  169.  
  170.     }
  171.   }
  172.  
  173.  
  174.   if ([result count] == 4) {
  175.  
  176.     for(int k = 0; k < 4; k++) {
  177.  
  178.  
  179.       id myobject = [result objectAtIndex:k];
  180.  
  181.       if ([myobject isKindOfClass: [UIKBTree class]]) {
  182.     UIKBTree *mykbtree = (UIKBTree *)myobject;
  183.  
  184.  
  185.  
  186.     NSMutableArray *resultx = [[NSMutableArray alloc] initWithArray:mykbtree.subtrees];
  187.  
  188.     mykbtree.subtrees = resultx;
  189.  
  190.  
  191.     if([resultx count] == 1){
  192.  
  193.       for(int i = 0; i < 1; i++) {
  194.         id myobject2 = [resultx objectAtIndex:i];
  195.         if ([myobject2 isKindOfClass: [UIKBShape class]]) {
  196.           UIKBShape *myshape = (UIKBShape *)myobject2;
  197.  
  198.           CGRect rect;
  199.           if(layout != nil && (layout.orientation == 3 || layout.orientation == 4))
  200.         rect=CGRectMake(900, 5, 110, 61);
  201.           else
  202.         rect=CGRectMake(671, 3, 90, 50);
  203.  
  204.           myshape.paddedFrame = rect;
  205.         }
  206.       }
  207.     }
  208.  
  209.  
  210.     if([resultx count] == 2){
  211.  
  212.       for(int i = 0; i < 2; i++) {
  213.         id myobject2 = [resultx objectAtIndex:i];
  214.         if ([myobject2 isKindOfClass: [UIKBShape class]]) {
  215.           UIKBShape *myshape = (UIKBShape *)myobject2;
  216.  
  217.           CGRect rect;
  218.           if(layout != nil && (layout.orientation == 3 || layout.orientation == 4))
  219.         rect=CGRectMake(myshape.frame.origin.x, 204, 73, 62);
  220.           else
  221.         rect=CGRectMake(myshape.frame.origin.x, 150, 55, 50);
  222.  
  223.           myshape.paddedFrame = rect;
  224.         }
  225.       }
  226.  
  227.  
  228.  
  229.  
  230.     }
  231.       }
  232.     }
  233.  
  234.   }
  235.  
  236.  
  237.  
  238.   return result;
  239. }
Add Comment
Please, Sign In to add comment