• 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: NSCollectionView Subclass difficulties
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSCollectionView Subclass difficulties


  • Subject: Re: NSCollectionView Subclass difficulties
  • From: Jens Alfke <email@hidden>
  • Date: Sun, 10 Feb 2008 19:41:36 -0800


On 10 Feb '08, at 7:31 PM, Jaime Magiera wrote:

	if([[[object header] objectForKey:@"type"] isEqualToString:@"Video"])
	{
		[videoPrototype setRepresentedObject:object];
		return videoPrototype;
	} else {
		[genericPrototype setRepresentedObject:object];
		return genericPrototype;
	}

You're returning the same object every time. The method should, as its name implies, return a new object every time it's called. You can either make a fresh copy of a prototype object, or use alloc/init to create a new one.


—Jens_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSCollectionView Subclass difficulties
      • From: Jaime Magiera <email@hidden>
References: 
 >NSCollectionView Subclass difficulties (From: Jaime Magiera <email@hidden>)

  • Prev by Date: Re: self = [super init] debate.
  • Next by Date: Re: NSCollectionView Subclass difficulties
  • Previous by thread: NSCollectionView Subclass difficulties
  • Next by thread: Re: NSCollectionView Subclass difficulties
  • Index(es):
    • Date
    • Thread