Xcode cant find the method


#1

Hello guys,

Its my first post here. I love this book!!
Quick introduction : Its my first book about Objective-C and I have nooo programming experience whatsoever.
I just want to make app’s, and I want to do it professionally. I am from Belgium and I teach it to myself 6 hours a day while im at work. ( im 20years old )

I understand most things, and other things come more clearer when I continued reading, so far so good but I still need to learn ALOT!

My problem is, as you will see in the images, and I still dont understand what I did wrong… Is that xcode cant find the methode in the main.m file, when it is clearly in my header file.

Can you guys see what I did wrong?
( link to image where you see that xcode says that he cant find the method)
[IMG]http://img5.imageshack.us/img5/9513/86jn.png[IMG]

(link to image where you can clearly see that it is in the header
[IMG]http://img692.imageshack.us/img692/4786/63fg.png[IMG]

Im looking forward for an solution.

Kind regards


#2

Okay,

I see that my WeightInKilos whas typed as WeightInMeters, I changed that now, but still it is given me the same error.

Just for letting you know,

greetings


#3

I’m not 100% positive, but I think I found your problem…

Person *Dylan = [[Person alloc] init];
//This is where your code goes wrong
[Person setWeightInKilos: 99];

Since you used *Dylan your code should instead look like this:

[Dylan setWeightInKilos: 99];

#4

Hey,

That whas indeed the problem :stuck_out_tongue: i feel so stupid I didnt see that.
A big thank you for your answer.

Now I have a small extra question;

Why does my header and so start with PersonAppDelegate? It doesnt do sow in the book?
Or is this because I am working with Xcode5.

Kind regards,
Dylan


#5

Hi Dylan,

When you created your project, you must have used “Person” as the “Class Prefix” in the second window (Choose options for your new project:), where you add the “Product Name” etc.

You don’t have to add anything here, however most people will use their initials, or initials of their company etc.

Nick