ConnectionKit updates no.2: Transcripts

Mostly as an extremely helpful debugging aid, ConnectionKit has provision for providing a transcript of its operations. Originally, this operated by the very simple -[CKConnection setTranscript:(NSTextStorage *)] method. This has now been replaced on the branch (and will be on the trunk soonish) with a delegate method:

- (void)connection:(id <CKConnection>)connection appendString:(NSString *)string toTranscript:(CKTranscriptType)transcript

This provides several advantages:

  • The delegate can send this output anywhere it likes; a text view, the console or even a WebView.
  • Filtering can be applied to only add certain output to the final transcript, or split into several distinct logs.
  • Applications can apply their own formatting to the text, or use +[CKAbstractConnection attributedStringForString:transcript:] to use the ConnectionKit defaults.
  • Any custom classes implementing the CKConnection protocol have one less method to implement.
© Mike Abdullah 2007-2015