| Article: |
Networking in Cocoa | |
| Subject: | a little improvement | |
| Date: | 2003-05-29 22:06:43 | |
| From: | anonymous2 | |
|
Response to: a little improvement
|
||
|
Sorry to press the return by accident, let's continue:
|
||
Showing messages 1 through 1 of 1.
| Article: |
Networking in Cocoa | |
| Subject: | a little improvement | |
| Date: | 2003-05-29 22:06:43 | |
| From: | anonymous2 | |
|
Response to: a little improvement
|
||
|
Sorry to press the return by accident, let's continue:
|
||
Showing messages 1 through 1 of 1.
When we call postMessage:fromPerson in receiveMessage: we can change our call from:
[self postMessage:[msgComponents objectAtIndex:2]
fromPerson:[msgComponents objectAtIndex:1]];
To:
[self postMessage:[msgComponents [[subArrayWithRange: NSMakeRange(2, [msgComponents length] - 1)] componentsJoinedByString:@":"]] fromPerson:[msgComponents objectAtIndex:1]];
Please double check brackets and that I've constructed that range properly. Granted, this doesn't make for easy reading, but it can be broken up over a couple of lines.