Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 10th, 2012  |  syntax: None  |  size: 0.52 KB  |  hits: 33  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Can a method definition specify that a parameter must be a constant?
  2. + (void) replace_text_with: (NSString *) const predefined_text_style;
  3.        
  4. typedef enum {
  5.     FOOMy1stValue,
  6.     FOOMy2ndValue,
  7.     FOOMy3rdValue
  8. } FOOEnum;
  9.        
  10. NSString *FOOGetStringFromEnum(FOOEnum e) {
  11.     static NSString *strings[] = {
  12.         @"My first value",
  13.         @"My second value",
  14.         @"My third value"
  15.     };
  16.     return strings[e];
  17. }
  18.        
  19. void FOORestrictedInput(FOOEnum e) {
  20.     NSLog(@"Restricted string: %@", FOOGetStringFromEnum(e));
  21. }