PeterK
PeterK

Reputation: 4301

problem passing multiple parameters

[EDIT] ===PROBLEM SOLVED====

====JUST AFTER I SUBMITTED I SAW THE OBVIOUS====

Wrong name in the call "andUpdate", should be "andWriteRead:". Just realize i am a blind person.

Hi,

I am passing multiple parameters in messages in other parts of my code without problem but with this i have problem. It works perfectly passing one parameter but not with two. I would guess it is just me who doesn't see the forrest because of the trees. Could someone please look at this and tell me what i am doing wrong?

The following works:

message:

[setupQuestions questionsNumbersPLIST:diffLvls];

Target object.

.h:

- (void)questionsNumbersPLIST:(NSMutableArray *)questionsList;

.m:

- (void)questionsNumbersPLIST:(NSMutableArray *)questionsList {

=========================================

Then i try to pass multiple parameters like this:

message:

[setupQuestions questionsNumbersPLIST:diffLvls andUpdate:myString];

Target object

.h:

- (void)questionsNumbersPLIST:(NSMutableArray *)questionsList andWriteRead:(NSString *)update;

.m:

- (void)questionsNumbersPLIST:(NSMutableArray *)questionsList andWriteRead:(NSString *)update;

I get:

warning: (Messages without a matching method signature

Upvotes: 0

Views: 329

Answers (1)

Jason Coco
Jason Coco

Reputation: 78353

You named your method quetionsNumbersPLIST:andWriteRead: so you have to call it that way, you can't just arbitrarily rename it. So to call it:

[setupQuestions questionsNumbersPLIST:diffLvls andWriteRead:myString];

Upvotes: 2

Related Questions