objective c - With typedef enum, return type enum EnumName produces compiler error when returning an enum member -


मेरे पास एक enum है

  टाइपिंगफ़ enum {kOne, kTwo, kThree, kFour} Enums ;   

और, मेरे .h फ़ाइल में मेरे पास

  - (enum Enums) getEnum;   

मेरी .m फ़ाइल में मेरे पास

  - (enum Enums) getEnum {return kOne; }   

हालांकि, मुझे त्रुटि मिल रही है

असंगत परिणाम प्रकार 'enum Enums' के साथ एक समारोह से 'int' लौट रहा है < / blockquote>

मैं एक एंमाम में लौट रहा हूं इसलिए मुझे यकीन नहीं है कि त्रुटि क्या है।

आपकी विधि हस्ताक्षर होनी चाहिए: <पूर्व> - (Enums) getEnum;

Comments

Popular posts from this blog

c# - passing input text from view to contoller with FacebookContext using Facebook app -

ios - Does Core Data autoupdate a many to many relationship on saving -

Calling a C++ function from C# by passing a string with variable size to it -