Advertisements

Reserved Keywords


Objective-C reserves certain words, so that you can’t, or shouldn’t, use them in your own code. At best, you’ll get a compiler warning or error; at worst, you’ll get a nasty bug that you won’t discover until millions of people are already using your app. Here is a list of reserved keywords, to help you avoid that pitfall.

Words You Can’t Use Words You Shouldn’t Use
auto BOOL
break Class
case bycopy
char byref
const id
continue IMP
default in
do inout
double nil
else NO
enum NULL
extern oneway
float out
for Protocol
goto SEL
if self
inline super
int YES
long @interface
register @end
restrict @implementation
return @protocol
short @class
signed @public
sizeof @protected
static @private
struct @property
switch @try
typedef @throw
union @catch()
unsigned @finally
void @synthesize
volatile @dynamic
while @selector
_Bool atomic
_Complex nonatomic
_Imaginery retain
Advertisements
Leave a comment

6 Comments

  1. Kenny Ray

     /  August 14, 2013

    Thanks for this list. I’m trying to find out if “name” can be used as a property name. I’m not seeing anything anywhere indicating that it is used internally like “id” is. (Found that one out the hard way).

    Reply
  1. Objective-C Lesson 2: Basic Variables « Programming for iOS
  2. Learn Objective-C in 24 Days « Programming for iOS
  3. » Reserved keywords in Objective-C SnowCrash

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Advertisements
  • Welcome

    My goal is to make CupsOfCocoa into a beautiful source for beginners to the iPhone platform to get started. Subscribe below for more, and stay tuned!

  • Contact Me

    If you need to contact me for any reason, feel free to send me an email.
  • The Giving Spirit

    If you've found this site helpful, would you consider donating a little sum? Any amount is appreciated...Thanks so much!

  • Roadmap

  • Enter your email address to follow this blog and receive notifications of new posts by email.

    Join 222 other followers

  • Back to the Past

    September 2010
    S M T W T F S
    « Aug   Oct »
     1234
    567891011
    12131415161718
    19202122232425
    2627282930  
  • Time Machine

  • You count!

    • 621,662 views
  • Worldwide Stats

    free counters
  • Advertisements
%d bloggers like this: