Are you a regular stikked user? Signup so you can keep track of your pastes!

RE: Untitled

By Small Motmot, 1 Year ago, written in Objective-C. This paste is a reply to Untitled by Soft Gorilla
URL http://stikked.com/view/23120359
  1. - (void) validateRuleWithParamater: (NSString * const) rule candidate: (id) candidate tag: (NSString *) tag parameter: (id) parameter {
  2.     SEL selector = NSSelectorFromString([rule stringByAppendingString:@"parameter:"]);
  3.     BOOL isValid;
  4.    
  5.     // Check if this method takes a paramter
  6.     if([self respondsToSelector:selector])
  7.     {
  8.         isValid = [self performSelector:selector withObject:candidate withObject:parameter];
  9.     }
  10.     else
  11.     {
  12.         selector = NSSelectorFromString(rule);
  13.         isValid = [self performSelector:selector withObject:candidate];
  14.     }
  15.    
  16.     [self modifyErrorTable:tag method:rule isValid:isValid];
  17.     if(!isValid) [tempErrors addObject:[errorStrings objectForKey:rule]];
  18. }

Reply to "RE: Untitled"

Here you can reply to the paste above

Create a snipurl

Make Private

Feeling clever? Set some advanced options.