This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes iOS and the fly likes Help a noob with inheritance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Mobile » iOS
Bookmark "Help a noob with inheritance" Watch "Help a noob with inheritance" New topic

Help a noob with inheritance

Ben Alex Barreto

Joined: May 10, 2011
Posts: 15

So I've been trying to learn Objective-C, and yesterday I was looking at how inheritance works.

I created two classes, Person and Employee. The later is supposed to inherit from Person. The problem is that I'm getting this error "No visible @inerface for Employee" when I try to instantiate an Employee and set its weightInKilos or heightInMeters. Here are the header and implementation files:

And here is the main

I'm just trying to learn. What am I doing wrong?

Hussein Baghdadi
clojure forum advocate

Joined: Nov 08, 2003
Posts: 3479

I copied your code and run it with a flying colors without any error.

Do you a duplicated file here and there (such as Person.h/Person.m/Employee.h/Employee.m) ?
I agree. Here's the link:
subject: Help a noob with inheritance
jQuery in Action, 3rd edition