{"id":5443,"date":"2014-03-30T22:00:35","date_gmt":"2014-03-30T22:00:35","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/how-add-new-enums-in-typedef-enum-in-objective-c-collection-of-common-programming-errors\/"},"modified":"2014-03-30T22:00:35","modified_gmt":"2014-03-30T22:00:35","slug":"how-add-new-enums-in-typedef-enum-in-objective-c-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/how-add-new-enums-in-typedef-enum-in-objective-c-collection-of-common-programming-errors\/","title":{"rendered":"How add new enums in typedef enum in Objective C?-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/6d2acfb42ed883e5e6ec8969262f5c61?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJohannes Rudolph<\/p>\n<p>I need help, i have typedef enum:<\/p>\n<pre><code>typedef enum category\n{\n    All, \n    category1,\n    category2,\n    category3,\n    category4,\n} category;\n<\/code><\/pre>\n<p>Can I add new enums in category, for example:<\/p>\n<pre><code>typedef enum category\n{\n    All, \n    category1,\n    category2,\n    category3,\n    category4,\n    category5,\n    category6,\n    category7,\n} category;\n<\/code><\/pre>\n<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/cb3b80f99b97ba88183ceaff1c97741d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\njrturton<\/p>\n<p>Yes, you can. Just add them. You aren&#8217;t changing the values of the existing ones or changing the order, so any storage of these values in your previous version will be unaffected.<\/p>\n<p>If you want to update the list at runtime, as suggested in your comments, then this isn&#8217;t possible and an enum is the wrong structure to be using. An enum isn&#8217;t much more than a fancy list of constants. You would need a different solution.<\/p>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Johannes Rudolph I need help, i have typedef enum: typedef enum category { All, category1, category2, category3, category4, } category; Can I add new enums in category, for example: typedef enum category { All, category1, category2, category3, category4, category5, category6, category7, } category; jrturton Yes, you can. Just add them. You aren&#8217;t changing the values [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5443","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5443","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5443"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5443\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}