I'm trying to get a string in my call from an array. But have no luck. It's being passed to another class.
MainClass.h
#import First
@class First;
@interface MainClass : UIViewController{
NSMutableArray *listArray;
}
///////////////////
MainClass.m
First *first = [[First alloc] init];
listArray = [[NSMutableArray alloc]init];
[listArray addObject:@"first"];
[listArray addObject:@"second"];
int Aslot = 0;
int sumA;
float level = 5, insample = 10;
NSString *slotA =[listArray objectAtIndex:ASlot];
sumA = [slotA out:insample andlevels:level];
/////////
First.h
-(float)out:(float)insample andlevels:(float)level;
First.m
-(float)out:(float)insample andlevels:(float)level{
float outsample = insample + 10 * level;
return outsample;
}
I want slotA (the Class) to equal a string from the array "first" or "second", so it can call the method.
I have a table which when I select first, it sends samples and other parameters to another class where it does processing then returns back to MainClass.
sumA = [first out:insample andlevels:level];
But I'm getting an error saying that NSString may not respond to my parameters out:andlevels. Please help..