• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
A category for NSMatrix?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: A category for NSMatrix?
      • From: Chris Gehlker <email@hidden>
    • Re: A category for NSMatrix?
      • From: Ondra Cada <email@hidden>
  • Prev by Date: Re: Would Any Developers Use This?
  • Next by Date: *That* book
  • Previous by thread: Strange behavior with stringWithContentsOfURL using ppp or dsl
  • Next by thread: Re: A category for NSMatrix?
  • Index(es):
    • Date
    • Thread