1

I'm learning Objective C and I'm totally newbie ^^.

I'm making a simple application called BookStore. I have 2 class to store a data:

  1. Book: to store a data related to book such as (title, author, desc...)
  2. Bookstore: to store books

My application will show all the book title in MasterViewController and when users touch on any of book title, the DetailViewController will show book's details.

This is a code that I use to declare in MasterViewController.h

#import <UIKit/UIKit.h>
#import "Bookstore.h" // This is what I tried to change, I import instead of using @class
@class LKDetailViewController;
//@class Bookstore; // <= This is what's exactly my ebook tell me
@interface LKMasterViewController : UITableViewController

@property (strong, nonatomic) LKDetailViewController *detailViewController;
@property (strong, nonatomic) Bookstore *myBookStore;
@end

So can I use #import instead of @class like this to let the complier know about my Bookstore class? I just wondering which one is be right way?

Thank you so much.

lionK
  • 27
  • 8
  • http://stackoverflow.com/questions/253051/whats-the-difference-between-import-and-class-and-when-should-i-use-one-over – iPatel Apr 06 '13 at 08:01

0 Answers0