开发者

error: expected specifier-qualifier-list before 'SearchViewController'

开发者 https://www.devze.com 2023-01-14 15:25 出处:网络
i have a search view controller like below. @interface SearchViewController : { TopicRulesViewController *TViewController;

i have a search view controller like below.

@interface SearchViewController : {
TopicRulesViewController *TViewController;
}

i want to move to another view.but i am getting this "error: expected specifier-qualifier-list before 'TopicRulesViewControlle开发者_高级运维r'" what is that error?

thanks in advance


You are missing a superclass after the :


You need to import header where TopicRulesViewController class is declared, or, even better - use forward declaration in header file and import necessary header in implementation file:

//header
@class TopicRulesViewController;

@interface SearchViewController : UIViewController{
    TopicRulesViewController *TViewController;
}

//m-file
#import "TopicRulesViewController.h"
...

P.S. You also miss superclass for SearchViewController class, but that produces different compiler error so I assumed that that was just a typo...

0

精彩评论

暂无评论...
验证码 换一张
取 消