Guest User

Untitled

a guest
Jul 12th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. // Enums.h
  2. namespace CARS
  3. {
  4. enum CARS
  5. {
  6. ROLLSROYCE
  7. };
  8. }
  9. namespace BEAUTIFULCARS
  10. {
  11. enum BEAUTIFULCARS
  12. {
  13. ROLLSROYCE = 45
  14. };
  15. }
  16.  
  17. #import "Enums.h"
  18.  
  19. -(void)printEnumvals
  20. {
  21. NSLog(@"CARS %d BEAUTIFULCARS %d",
  22. CARS::ROLLSROYCE,
  23. BEAUTIFULCARS::ROLLSROYCE);
  24. }
  25.  
  26. // CARS.h
  27. @interface BEAUTIFULCARS : NSObject
  28. {
  29. enum
  30. {
  31. BEAUTIFULCARS_ROLLSROYCE = 45
  32. } BEAUTIFULCARS;
  33. }
  34. @end
  35. @interface CARS : NSObject
  36. {
  37. enum
  38. {
  39. CARS_ROLLSROYCE
  40. } CARS;
  41. }
  42. @end
  43.  
  44. // CARS.m
  45. @implementation BEAUTIFULCARS
  46. +(NSInteger)ROLLSROYCE{ return BEAUTIFULCARS_ROLLSROYCE; }
  47. @end
  48. @implementation CARS
  49. +(NSInteger)ROLLSROYCE{ return CARS_ROLLSROYCE; }
  50. @end
  51.  
  52. #import "CARS.h"
  53.  
  54. -(void)printEnumvals
  55. {
  56. NSLog(@"CARS %d BEAUTIFULCARS %d",
  57. CARS.ROLLSROYCE,
  58. BEAUTIFULCARS.ROLLSROYCE);
  59. }
Add Comment
Please, Sign In to add comment