A category for NSMatrix?
A category for NSMatrix?
- Subject: A category for NSMatrix?
- From: "Rafael K. Kobylinski" <email@hidden>
- Date: Wed, 12 Sep 2001 11:17:21 +0200
Hello List,
I am new to Objective-C and Cocoa and working my way through the
O'Reilly book. In Chapter 13, the author defines a simple utility
function clearButtonMatrix - I was wondering whether this really
should be rather implemented in a new category for NSMatrix (as the
concept of categories is new to me, I am not quite sure what the
implications would be).
The function is defined as follows:
void clearButtonMatrix(id matrix)
{
int i, rows, cols;
[matrix getNumberOfRows: &rows columns: &cols];
for (i = 0; i < rows; i++)
[[matrix cellAtRow: i column: 0] setState: NO];
}
I noticed that the input paremter is typed to id rather than
NSMatrix, although it seems to me that this function is always called
with a NSMatrix.
Anyone willing to share his insights on the possible drawbacks of
using a category instead in this case?
--
Rafael K. Kobylinski Email: email@hidden
Institut f|r Informatik Tel. : ++ 49 89 289 22391
Technische Universitdt M|nchen Cell.: ++ 49 177 7 495020