Reserved keywords in Objective-C

Sometimes you’ll be happily coding a way and then something seems a bit awry.

E.g. I suddenly found I couldn’t connect an IBAction from a View to a Controller. It turned out it was because I was using a reserved keyword, register:

In hindsight pretty obvious but puzzling at the time as I wasn’t getting an error.

Words You Can’t Use
auto
break
case
char
const
continue
default
do
double
else
enum
extern
float
for
goto
if
inline
int
long
register
restrict
return
short
signed
sizeof
static
struct
switch
typedef
union
unsigned
void
volatile
while
_Bool
_Complex
_Imaginery

Words You Shouldn’t Use
BOOL
Class
bycopy
byref
id
IMP
in
inout
nil
NO
NULL
oneway
out
Protocol
SEL
self
super
YES
@interface
@end
@implementation
@protocol
@class
@public
@protected
@private
@property
@try
@throw
@catch()
@finally
@synthesize
@dynamic
@selector
atomic
nonatomic
retain

http://cupsofcocoa.com/2010/09/09/reserved-keywords/

One thought on “Reserved keywords in Objective-C

  1. JB says:

    dont use “description” as that is the default method use to print an object.

Leave a Reply

Your email address will not be published. Required fields are marked *