super viewdidload giving me a no visible @interface for uitableview declares for the selector viewdidload

StackOverflow https://stackoverflow.com/questions/22110471

문제

Here is my current code. I have not even gotten past the viewDidLoad method override because on the line where it says super viewdidload it throws the error @interface for uitableview declares for the selector viewdidload.

I am not too familiar with iPhone development and i am still beginning. Can someone please help me with this

my code

@interface myUITVC : UITableViewController UITableViewDelegate, UITableViewDataSource>

@property (nonatomic, strong) NSMutableArray *array;

@end


@implementation myUITVC

-(void)viewDidLoad
{
[super viewDidLoad];
}

@end
도움이 되었습니까?

해결책

  1. You don't have to declare the table delegate and data source if you're subclassing UITableViewController (since UITableViewController declares it.)

    Change

    @interface myUITVC : UITableViewController UITableViewDelegate, UITableViewDataSource>
    

    to

    @interface myUITVC : UITableViewController
    
  2. You're missing a capital "D" in viewDidLoad.

다른 팁

Looks like you're just missing a < before the UITableViewDelegate declaration.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top