title: What are the limits of using a ternary operator in Objective-C?
body: <p>The following Objective-C statement does not work correctly.</p>
  
  <pre><code>cell.templateTitle.text=[(NSDictionary*) [self.inSearchMode?self.templates:self.filteredTemplates objectAtIndex:indexPath.row] objectForKey:@"title"];
  </code></pre>
  
  <p>However, if I split it into an <code>if()</code> statement it works fine.</p>
  
  <pre><code>if(self.inSearchMode){
    categorize=[(NSDictionary*)[self.filteredTemplates objectAtIndex:indexPath.row] objectForKey:@"categorize"];
  } else {
    categorize=[(NSDictionary*)[self.templates objectAtIndex:indexPath.row] objectForKey:@"categorize"]; 
  }
  </code></pre>
  
  <p>What are the limitations of using the ternary operator in Objective-C? In other languages like C# the above ternary statement would have worked correctly.</p>