Субъективный Си / Говнокод #8774 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
  49. 49
  50. 50
  51. 51
  52. 52
  53. 53
  54. 54
  55. 55
  56. 56
  57. 57
  58. 58
  59. 59
  60. 60
  61. 61
  62. 62
  63. 63
@try {
        NSMutableArray *items = nil;
        if(isGrouped){
            items = [NSMutableArray arrayWithArray:[_sortedItemsDict objectForKey:[_alphabet objectAtIndex:section]]];
        }else{
            items = _itemsArray;
        }
        [cell.textLabel setText:[[items objectAtIndex:row] name]?[[items objectAtIndex:row] name]:@"No Title"];
        
        if([[items objectAtIndex:row] isKindOfClass:[Song class]]){
            
            Song *song = (Song*)[items objectAtIndex:row];
            
            [cell.detailTextLabel setText:[NSString stringWithFormat:@"%@ %@", [song albumName]?[song albumName]:[NSString string], [song artistName]]?[song artistName]:[NSString string]];
            
            if([song isAvailableAtItunes])
                NSLog(@"%@ %d", [song name], [song ID]);
            
            [cell setTag:[song ID]];
            
        }else if([[items objectAtIndex:row] isKindOfClass:[Album class]]){
            
            [cell.detailTextLabel setText:[NSString stringWithFormat:@"%@", [[items objectAtIndex:row] artistName]]?[[items objectAtIndex:row] artistName]:[NSString string]];
            
        }else if([[items objectAtIndex:row] isKindOfClass:[Podcast class]] || [[items objectAtIndex:row] isKindOfClass:[Audiobook class]]){
            [cell setTag:[[items objectAtIndex:row]ID]];
        }
        
        if(!isFromSelfLibrary){
        
            if(items && ([[items objectAtIndex:row] isKindOfClass:[Song class]] || [[items objectAtIndex:row] isKindOfClass:[Podcast class]] || [[items objectAtIndex:row] isKindOfClass:[Audiobook class]])){
            
                if([[items objectAtIndex:row]isAvailableAtItunes]){
                
                    for(UIView *view in [cell subviews]){
                        if(view.tag == 111){
                            [view setHidden:NO];
                        }
                    }
                }else{
                    [[DataController instance] checkItem:[items objectAtIndex:row]];
                }
                [cellsDict setValue:cell forKey:[NSString stringWithFormat:@"%d",[cell tag]]];
            }
        }
        
        if(items && ![[items objectAtIndex:row] isKindOfClass:[Song class]] 
           && ![[items objectAtIndex:row] isKindOfClass:[Podcast class]]
           && ![[items objectAtIndex:row] isKindOfClass:[Audiobook class]])
        {
            [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
        }
        [cell.textLabel setTextColor:[UIColor whiteColor]];
        [cell.textLabel setShadowColor:[UIColor blackColor]];
        [cell.textLabel setShadowOffset:CGSizeMake(0, 1)];
        [cell.detailTextLabel setTextColor:[UIColor lightGrayColor]];
        [cell.detailTextLabel setShadowOffset:CGSizeMake(0, 1)];
        [cell.detailTextLabel setShadowColor:[UIColor blackColor]];
        [tableView deselectRowAtIndexPath: indexPath animated: YES];
    }
    @catch (NSException *exception) {
        NSLog(@"olo1");
    }

Не то, чтобы отлов исключения меня печалит.... :'(

Запостил: lime lime, (Updated )

Комментарии (7) RSS

  • Египетские скобки - вот настоящий говнокод! Сломал глаза...
    Ответить
      • Египетские скобки - это плохо... очень плохо! Это просто полный отстой, мешающий нормально читать код. А когда ко всему еще if else на одной строке, вообще хочется закрыть и не читать этот говнокод!
        Ответить
        • Вообще, если правильно комбинировать скобки с точкой - то такого говна не будет. Т.е. для доступа к свойствам всегда юзать точку, а для послыки сообщений скобки - все будет хорошо.
          Ответить
  • у,F,TA)I:E.N?RZ,H$B)R:M(Q:I X"F D!F.K"O!Y$C(O,U$N"Z(L"M:V"KJ?Z!X.M:V"F!C"F)A?T:B,U JОSZBTMNLQGEI
    Ответить

Добавить комментарий

Я, guest, находясь в здравом уме и твердой памяти, торжественно заявляю:

    А не использовать ли нам bbcode?


    8