Replacement for 'setDelegate' in Xcode 5

808 views Asked by At

I'm trying to make a database app for my A level coursework, but I'm unable to get around this problem; I'm learning the database skills from a 4.5 video, and Xcode 5 throws a tantrum when I try to use "set delegate' for my table, is there a way around this?

- (void)viewDidLoad
{
    [super viewDidLoad];
    [[self Mytableveiw]setDelegate:self]
    [[self mytableveiw] setDataSource:self]

}

I'd appreciate any help you have.

3

There are 3 answers

0
Antonio MG On

You are misspelling it, change this:

[[self Mytableveiw]setDelegate:self]

To this:

[[self mytableveiw]setDelegate:self]

You are using the name of the class, not the variable.

1
Bhumeshwer katre On

It is not the related to xcode

Replace this

[[self Mytableveiw]setDelegate:self]

with

[[self mytableveiw]setDelegate:self]
4
CarlJ On

Offtopic: please only use brackets if you call a method and use the dot Notation for accessing properties

[[self mytableveiw]setDelegate:self]

should be:

self.mytableveiw.delegate = self;