Created
April 1, 2011 04:55
-
-
Save sbrocket/897761 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Works | |
| if (self.currentScope == 1) { | |
| cell.contentViewInsets = UIEdgeInsetsMake(0, 0, 0, 2); | |
| } else { | |
| cell.contentViewInsets = UIEdgeInsetsZero; | |
| } | |
| // Works | |
| UIEdgeInsets inset = (self.currentScope == 1) ? UIEdgeInsetsMake(0, 0, 0, 2) : UIEdgeInsetsZero; | |
| cell.contentViewInsets = inset; | |
| // Works, guess its related to dot syntax | |
| [cell setContentViewInsets:(self.currentScope == 1) ? UIEdgeInsetsMake(0, 0, 0, 2) : UIEdgeInsetsZero]; | |
| // Doesn't work, compiler warning & error | |
| cell.contentViewInsets = (self.currentScope == 1) ? UIEdgeInsetsMake(0, 0, 0, 2) : UIEdgeInsetsZero; | |
| // More variations that don't work | |
| cell.contentViewInsets = ((self.currentScope == 1) ? UIEdgeInsetsMake(0, 0, 0, 2) : UIEdgeInsetsZero); | |
| cell.contentViewInsets = (self.currentScope == 1) ? (UIEdgeInsetsMake(0, 0, 0, 2)) : UIEdgeInsetsZero; | |
| cell.contentViewInsets = (self.currentScope == 1) ? (UIEdgeInsetsMake){0, 0, 0, 2} : UIEdgeInsetsZero; | |
| cell.contentViewInsets = ({(self.currentScope == 1) ? UIEdgeInsetsMake(0, 0, 0, 2) : UIEdgeInsetsZero;}); | |
| error: assignment of read-only variable 'prop.282' | |
| warning: left-hand operand of comma expression has no effect | |
| Compiler is either "GCC 4.2" or "LLVM GCC 4.2" in Xcode 4.0 4A304a | |
| Compiles correctly with "LLVM compiler 2.0" selected |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment