Datenshi
Datenshi

Reputation: 1191

@end in c-objective

Ok, it may be a dumb mistake. But I can't figure out what xcode wants from me.

So here is the header file

#import <Foundation/Foundation.h>
#import "TableViewController.h"

@end
@interface Settings : NSObject

- (id)init: (TableViewController*) TableControll;

@end

If there is no @end before interface it says expected identifier or (, and suggests adding @end there. If there is an @end it says end must appear in objective-c contex.

Ideas?

#import <UIKit/UIKit.h>
#import <MessageUI/MessageUI.h>
#import <MessageUI/MFMessageComposeViewController.h>

@interface TableViewController :     UIViewController<UITableViewDataSource,UITableViewDelegate,MFMessageComposeViewControllerDelegate>
{
    ControllerType controllerType;
}

@property (retain, nonatomic) IBOutlet UITableView *tableView;
@property (retain, nonatomic) NSArray *dataArray;
@property (retain, nonatomic) NSArray *imageArray;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil andType:(ControllerType)type;

@end

Upvotes: 0

Views: 243

Answers (1)

Zack Brown
Zack Brown

Reputation: 6028

You have a @end before the @interface declaration in your Settings.h file.

It should read:

#import <Foundation/Foundation.h>
#import "TableViewController.h"

@interface Settings : NSObject

- (id)init: (TableViewController*) TableControll;

@end

Also, you haven't included the #import directive for ControllerType in your TableViewController.h which may be why you're getting obscure errors in your Settings.h file.

Upvotes: 2

Related Questions