20 ms·
The style guide (in that link at least) doesn't actually enforce or even mention alphabetical order for ivars. It seems an unusually proscriptive restriction fo
by scrumper 14y ago
The style guide (in that link at least) doesn't actually enforce or even mention alphabetical order for ivars. It seems an unusually proscriptive restriction for what's quite a reasonable style guide. The stated restriction - dealloc in declaration order - makes a lot of sense.
(Also, line lengths merely have to 'try' to be less than 80 characters, so there's wiggle room here too.)
- packetslave 14y agoNote that the public style guides aren't always a 1:1 match with the internal ones, usually for legacy reasons or to be more consistent with other internal languages. I don't see anything offhand in the internal ObjC guide about alphabetical order for ivars, so it's possible the OP misunderstood the "dealloc in declaration order" rule. It's also possible his specific project had a convention of sorting them alphabetically.
- tazzy531 14y agoAlso different teams have slight variations from the official style guide.