What is the difference between typedef and enum?



What is the difference between typedef and enum?..

Answer / Shubhansi

"In Objective-C, a `typedef` allows you to define a new name for an existing data type. An `enum` defines a new custom data type consisting of a set of named integer constants. For example:nn```objective-cntypedef NSInteger MyInt; // typedef for NSIntegernenum MyColors { Red, Green, Blue }; // enum for colors

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Objective-C Interview Questions

What is difference between objective c and swift programming?

1 Answers  


Can we implement dealloc in arc? If yes, what is the need to do that?

1 Answers  


What is the primary use of the category in the objective-c?

1 Answers  


What is the protocol in objective c?

1 Answers  


What is better objective c or swift?

1 Answers  


What's the difference between a thread safe and a thread unsafe function?

1 Answers  


What are nsautoreleasepool and how can we use them?

1 Answers  


How to use swift protocol in objective c?

1 Answers  


When might you use a cfarray/dictionary instead of a nsarray/dictionary?

1 Answers  


What is method swizzling in objective c and why would you use it?

1 Answers  


How do you write an objective statement?

1 Answers  


How is #import different from #include?

1 Answers  


Categories