Advertisement
radityakurnianto

SimpleLoop

Aug 10th, 2017
744
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int adpos = 2;
  2. int step = 0
  3.  
  4. for(int i = 0; i < array.count; i++) {
  5.     id object = array[i];
  6.     if ([object isKindOfClass:[RelatedNewsListModel class]]) {
  7.         if (step == adpos) {
  8.             [array insertObject:[DFPNativeModel new] atIndex:i];
  9.             step = -1;
  10.         }
  11.         step++;
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement