Guest User

Untitled

a guest
Aug 10th, 2012
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment