Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Hour 5. Using Compiler Directives > Using Objective-C Compiler Directives

Using Objective-C Compiler Directives

Objective-C compiler directives begin with @. You often use them to describe portions of a file. In the .h files, for example, @interface marks the beginning of the header interface code. That section is terminated by @end.

In the .m files, @implementation marks the beginning of the implementation, and it is terminated by @end.

Other common Objective-C compiler directives are used to introduce forward declarations such as @class MyClass or @protocol MyProtocol, which are defined in other parts of your code.

Strings in Objective-C are delimited with

@"this is a string"

where the @ alerts the compiler that a string follows.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial