forked from OpenEmu/OpenEmu
-
Notifications
You must be signed in to change notification settings - Fork 0
Style Guide
locks edited this page Oct 10, 2011
·
20 revisions
Herein lies some conventions used throughout the OpenEmu codebase. This list is by no means exhaustive and quite prototypal as of yet.
- Braces on their own line
- (void)method
{
}-
Block argument list and types on their own line int (^blk1)(int) = ^ int (int v) { };
-
Use 4 spaces instead of tabs
@implementation SomeClass
{
int ivar;
}- Class names are CamelCased
@implementation SomeClass
@endHere you can see a sample class:
@implementation SomeClass
{
int ivar;
}
- (void)method
{
if(booleanValue && obj != nil)
{
do
{
} while(value > 0);
}
while(value < 10)
{
}
void (^blk)(void) =
^{
// do things
};
int (^blk1)(int) =
^ int (int v)
{
// do things
};
}
@endFor more information read Apple's Coding Guidelines for Cocoa, since the project adheres to these.