Skip to content

Commit

Permalink
Initializers clarification
Browse files Browse the repository at this point in the history
  • Loading branch information
rwenderlich committed Nov 7, 2013
1 parent 6b540c6 commit 8d1845d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The official raywenderlich.com Objective-C style guide.

This style guide outlines the coding conventions for raywenderlich.com.
This style guide outlines the coding conventions for raywenderlich.com.

## Introduction

Expand Down Expand Up @@ -95,10 +95,10 @@ if (user.isHappy) {

Bad:
```objc
if (user.isHappy)
if (user.isHappy)
{
//Do something
}
}
else {
//Do something else
}
Expand Down Expand Up @@ -188,6 +188,8 @@ id varnm;

When using properties, instance variables should always be accessed and mutated using `self.`. This means that all properties will be visually distinct, as they will all be prefaced with `self.`. Local variables should not contain underscores.

An exception to this: iniside initializers, the backing instance variable (i.e. _variableName) should be used directly to avoid any potential side effects of the getters/setters.

## Methods

In method signatures, there should be a space after the scope (-/+ symbol). There should be a space between the method segments (matching Apple's style). Always include a keyword and be descriptive with the word before the argument which describes the argument.
Expand Down

0 comments on commit 8d1845d

Please sign in to comment.