FROM : K. Darcy Otto
DATE : Thu Mar 20 23:25:34 2008
So, I seem to be having a problem with the following code, and I think
I've traced it to how the messages are nested; but I cannot seem to
solve it. Consider the following code, which works without warnings
(self.sequent is an NSArray):
DeductionLine *dl1 = [self.sequent objectAtIndex:lineCount-1];
Justification *j1 = [dl1 justification];
NSString *rule1 = [j1 rule];
But the following line generates a warning: NSString may not respond
to -rule.
NSString *rule2 = [[[self.sequent objectAtIndex:lineCount-1]
justification] rule];
I'm confused about the warning, because [[self.sequent
objectAtIndex:lineCount-1] justification] returns type Justification,
not NSString. Both examples compile and work; but the warning is in
the second case only. Why, and how can I get rid of the warning? Any
help would be appreciated. (I think I've included everything
necessary to diagnose the problem; please let me know if I haven't;
all of this is under Objective-C 2.0 with @synthesize sequent in
DeductionLine.)
DATE : Thu Mar 20 23:25:34 2008
So, I seem to be having a problem with the following code, and I think
I've traced it to how the messages are nested; but I cannot seem to
solve it. Consider the following code, which works without warnings
(self.sequent is an NSArray):
DeductionLine *dl1 = [self.sequent objectAtIndex:lineCount-1];
Justification *j1 = [dl1 justification];
NSString *rule1 = [j1 rule];
But the following line generates a warning: NSString may not respond
to -rule.
NSString *rule2 = [[[self.sequent objectAtIndex:lineCount-1]
justification] rule];
I'm confused about the warning, because [[self.sequent
objectAtIndex:lineCount-1] justification] returns type Justification,
not NSString. Both examples compile and work; but the warning is in
the second case only. Why, and how can I get rid of the warning? Any
help would be appreciated. (I think I've included everything
necessary to diagnose the problem; please let me know if I haven't;
all of this is under Objective-C 2.0 with @synthesize sequent in
DeductionLine.)
| Related mails | Author | Date |
|---|---|---|
| K. Darcy Otto | Mar 20, 23:25 | |
| Quincey Morris | Mar 21, 00:16 | |
| K. Darcy Otto | Mar 21, 02:32 | |
| Jack Repenning | Mar 21, 03:04 |






Cocoa mail archive

