title: Does an approximation of C++'s "const methods" exist for Objective-C?
body: <p>Wondering if there's any accepted practice for approximating C++'s 'const methods' in Objective-C.  (new to the language from a C/C++ background)</p>
  
  <p>For instance:</p>
  
  <pre><code>class Foo {
    public:
       void canChangeMemberVars(void);
       char* asString(void) const;
  };
  </code></pre>
  
  <p>"asString()" gets a const <code>this</code> pointer, so even if you go rogue and decide to muck around with the instance's members it won't work.  I find labelling methods as const to be quite useful from a documentation standpoint for libraries I write.</p>
  
  <p>I'm in the midst of writing an Objective-C class library, and find myself wanting to be able to make specific methods const, and wondering if there's any language tricks to achieve this.</p>
  
  <p><em>Summarized</em>:</p>
  
  <p>At the end of the day is the the only way to achieve similar functionality to factor classes in Mutable and Immutable versions?  Making a simple note in the comments for each method isn't rigid enough for my purposes.</p>