title: Which of the following will be efficient or faster in iOS?
body: <p>Which of the following will be efficient or faster in iOS?</p>
  
  <p>/* Public Static Variable */</p>
  
  <pre><code>static UICollectionView *mDocsCollection;
  
  @interface ClassA ()
  {
  }
  @end
  
  @implementation ClassA
  
  - (UICollectionView *)documentsCollection
  {
      if (!mDocsCollection) {
          mDocsCollection = (UICollectionView *)[self.view viewWithTag:VIEW_TAG_DOCS_COLLECTION];
      }
      return mDocsCollection;
  }
  
  @end
  </code></pre>
  
  <p>/* Interface Variable */</p>
  
  <pre><code>@interface ClassA ()
  {
      UICollectionView *mDocsCollection;
  }
  @end
  
  @implementation ClassA
  
  - (UICollectionView *)documentsCollection
  {
      if (!mDocsCollection) {
          mDocsCollection = (UICollectionView *)[self.view viewWithTag:VIEW_TAG_DOCS_COLLECTION];
      }
      return mDocsCollection;
  }
  
  @end
  </code></pre>
  
  <p>/* Private Static Variable */</p>
  
  <pre><code>- (UICollectionView *)documentsCollection
  {
      static UICollectionView *docsCollection;
      if (!docsCollection) {
          docsCollection = (UICollectionView *)[self.view viewWithTag:VIEW_TAG_DOCS_COLLECTION];
      }
      return docsCollection;
  }
  </code></pre>
  
  <p>/* Typecasting is done every time (No Variables used) */</p>
  
  <pre><code>- (UICollectionView *)documentsCollection
  {
      return (UICollectionView *)[self.view viewWithTag:VIEW_TAG_DOCS_COLLECTION];
  }
  </code></pre>