• 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
Re: OCUnit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OCUnit


  • Subject: Re: OCUnit
  • From: Ben Dougall <email@hidden>
  • Date: Thu, 21 Aug 2003 20:59:00 +0100

On Thursday, August 21, 2003, at 08:32 pm, Thomas Davie wrote:


On Thursday, August 21, 2003, at 08:20 pm, Ben Dougall wrote:


On Thursday, August 21, 2003, at 12:36 pm, Thomas Davie wrote:

Hi,
I was wondering if anyone here had any experience of getting OCUnit working with Cocoa. I am trying to test an NSMutableArray subclass with it, but am getting some strange errors. The error I have at the moment is:

-[TestTaskList testAddAndRetrieveTask] : *** -addObject: only defined for abstract class. Define -[TaskList addObject:]!

I do not call addObject directly in the test, instead I call -(void)addTask:(Task *)newTask, which in turn calls -(void)addObject (along with a couple of other things). Does anyone know where the above error is coming from? It seems extremely odd, seing as NSMutableArray is not an abstract class.

i don't have a solution but i can say that an NSMutableArray is an abstract class, more specifically it's part of a class cluster that makes up NSMutableArray and NSArray. they're both abstract classes.

Could you explain a little farther, my understanding was that if you could instantiate a class then it wasn't an abstract class - As far as I understood an abstract class contained an interface on which to base a group of subclasses, but not the code to make the class it's self useful.

i don't know the absolute details but NSMutableArray is an abstract class to a class cluster. that means that when you use an NSMutableArray you're not actually using the NSMutableArray class itself, even though it looks like you are. you're indirectly via NSMutableArray using a sub class of NSMutableArray and which subclass, and what subclasses there actually are beneath NSMutableArray are invisable to you, so NSMutableArray acts like a front for multiple versions of NSMutableArray.

probably best to read the class cluster page on apple's document site: <http://developer.apple.com/documentation/Cocoa/Conceptual/Foundation/ Concepts/ClassClusters.html>
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: 
 >Re: OCUnit (From: Thomas Davie <email@hidden>)

  • Prev by Date: Ignoring windowWillClose on app termination
  • Next by Date: Title Bar placement
  • Previous by thread: Re: OCUnit
  • Next by thread: Re: OCUnit
  • Index(es):
    • Date
    • Thread