this is my class
#import “Year2011.h”
@implementation Year2011
- (void)Men:(double)speed{
if (ramspeed <= 180000) {
cal = 0;
}
here i have HelloViewController class how can i call Year2011 class and Men mathod.
now i tried like this.
@class Year2010;
IBOutlet Year2010 *Year2010;
calling
double speed=([anualIncome.text doubleValue]);
[Year2010 Men:income];
this one is showing unrecognized selector sent to classerr.guide me i’m new to objective c.
You are mixing up Class name and Instance name. You also seem to have problems understanding the scope of an instance.
-1- change your instance name to lowercase initial – that is
IBOutlet Year2010 *year2010;-2- change your method names to lowercase initial – that is
- (void)men:(double)speedThe compiler currently assumes that Men is a static class method, but you never defined it as such, hence the error.