objective c - Xcode - What is different when we use #import and @class to declare a object variable? -


this question has answer here:

i'm learning objective c , i'm totally newbie ^^.

i'm making simple application called bookstore. have 2 class store data:

  1. book: store data related book such (title, author, desc...)
  2. bookstore: store books

my application show book title in masterviewcontroller , when users touch on of book title, detailviewcontroller show book's details.

this code use declare in masterviewcontroller.h

#import <uikit/uikit.h> #import "bookstore.h" // tried change, import instead of using @class @class lkdetailviewcontroller; //@class bookstore; // <= what's ebook tell me @interface lkmasterviewcontroller : uitableviewcontroller  @property (strong, nonatomic) lkdetailviewcontroller *detailviewcontroller; @property (strong, nonatomic) bookstore *mybookstore; @end 

so can use #import instead of @class let complier know bookstore class? wondering 1 right way?

thank much.


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -