I'm new to Objective-C, but please help me out here.

What I'm seeing is that method signatures in Objective-C that take multiple parameters seem inconsistent.

Example:

- (void) sendEmail: (NSString *) toStr
         subject:(NSString *) subjectStr
         body:(NSString *) bodyStr;

OK, so here we have 3 "parameters" (at least that's what I'm used to calling them), but 2 of them have "external" names (subject, body) but the first one doesn't! Isn't there something wrong with that from a consistency/style point of view?

When we call this method we do it like:

[emailObj sendEmail:@"test@test.com" subject:@"testSub" body:@"this is a test"]

(Hopefully I did that right, remember I'm new to this.)

So the subject and the body are clearly marked in the call, but not the "to" address? It seems really wacked to me. Why is that first parameter getting special treatment?

Edit
Report