I have used the stack created at http://www.codeproject.com/Tips/226892/How-to-implement-Stack-in-Object-C, which will accept any object, but I actually want to use it to store an enum type.
When I was trying to assign an enum to it, the compiler said that enum cannot be converted into id. What should I do?
If your stack stores NSObjects you can simply cast the enum values to an integer (which they are) and box them in an NSNumber:
Adding to the stack:
Retrieving from the stack: