1. Список говнокодов пользователя stanislaw

    Всего: 3

  2. Objective C / Говнокод #17190

    −392

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    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
    // Somewhere in SWRevealViewController
    // Load any defined front/rear controllers from the storyboard
    // This method is intended to be overrided in case the default behavior will not meet your needs
    //
    - (void)loadStoryboardControllers 
    {
        if ( self.storyboard && _rearViewController == nil )
        {
            //Try each segue separately so it doesn't break prematurely if either Rear or Right views are not used.
            @try
            {
                [self performSegueWithIdentifier:SWSegueRearIdentifier sender:nil];
            }
            @catch(NSException *exception) {}
            
            @try
            {
                [self performSegueWithIdentifier:SWSegueFrontIdentifier sender:nil];
            }
            @catch(NSException *exception) {}
            
            @try
            {
                [self performSegueWithIdentifier:SWSegueRightIdentifier sender:nil];
            }
            @catch(NSException *exception) {}
        }
    }

    stanislaw, 26 Ноября 2014

    Комментарии (2)
  3. Objective C / Говнокод #17101

    −382

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    if (present) {
            // only if not pull down
            _isLoading = !self.refreshControl.isRefreshing;
            
            self.tableView.userInteractionEnabled = NO;
        }
        if (!present) {
            _isLoading = NO;
            
            self.tableView.userInteractionEnabled = YES;
        }

    stanislaw, 12 Ноября 2014

    Комментарии (2)
  4. Objective C / Говнокод #13463

    −120

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    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
    - (NSManagedObject *)entityForName:(NSString *)entityName withServerID:(NSString *)serverID inContext:(NSManagedObjectContext *)context
    {
        if ((entityName==nil) || ([entityName isEqualToString:@""]) || (serverID==nil) || ([serverID isEqualToString:@""]))
        {
            return nil;
        };
    
        NSFetchRequest *fr=[[NSFetchRequest alloc] init];
        [fr setEntity:[NSEntityDescription entityForName:entityName inManagedObjectContext:context]];
        [fr setPredicate:[NSPredicate predicateWithFormat:@"server_id == %@", serverID]];
        [fr setIncludesPropertyValues:YES];
        NSError *err;
        NSArray *res=[context executeFetchRequest:fr error:&err];
        if (err!=nil)
        {
            NSLog(@"PANIC: PTDataFetchHelper: entityWithName:serverID:inContext: an error occured while gathering objects. %@ | %@ | %@", err.localizedDescription, err.localizedFailureReason, err.localizedRecoverySuggestion);
            return nil;
        }
        else
        {
            if ([res count]<=0)
            {
                NSLog(@"[res count]<=0");
                //NSLog(@"PTDataFetchHelper: findEntity:%@ withServerID:%@ inContext: not found", entityName, serverID);
                return nil;
            }
            else if([res count]>1)
            {
                NSLog(@"PANIC: PTDataFetchHelper: entityWithName:serverID:inContext: unable to fetch single object. server_id uniqueness error");
                return nil;
            }
            else //[res count] == 1
            {
                return [res objectAtIndex:0];
            };
        };
    }

    Фетч

    stanislaw, 21 Июля 2013

    Комментарии (20)