• 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
Workaround [Re: NSTextView refuses to scroll inside of an NSCollectionView]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Workaround [Re: NSTextView refuses to scroll inside of an NSCollectionView]


  • Subject: Workaround [Re: NSTextView refuses to scroll inside of an NSCollectionView]
  • From: "email@hidden" <email@hidden>
  • Date: Sat, 6 Mar 2010 22:33:58 -0800

For the archives-

I ran into the problem where NSScrollviews from an NSCollectionViewItem's template view do not work properly in a collection view. This is a problem that was reported on this list back in 2007, and reported as a bug then, but is still broken in 10.6.2. I couldn't find a solution online so crafted one of my own.

My gift to future coders who run into this problem:


@interface CBScrollView:NSScrollview
{
}
@end

@implementation CBScrollView

- (void) fixScrollerTargets
{
    if ([self verticalScroller] && [[self verticalScroller] target] != self)
    {
        [[self verticalScroller] setTarget:self];
    }

    if ([self horizontalScroller] && [[self horizontalScroller] target] != self)
    {
        [[self horizontalScroller] setTarget:self];
    }
}

- (id)initWithCoder:(NSCoder *)decoder
{
    if (self = [super initWithCoder:decoder])
    {
        [self performSelector:@selector(fixScrollerTargets) withObject:nil afterDelay:0];
    }

    return self;
}

- (void) dealloc
{
    [NSObject cancelPreviousPerformRequestsWithTarget:self
        selector:@selector(fixScrollerTargets)
        object:nil];

    [super dealloc];
}


@end

_______________________________________________

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

  • Prev by Date: [Moderator] Re: cocoa-dev vs. Apple's dev forums? (OT)
  • Next by Date: Re: UIView as opposed to UIViewController...
  • Previous by thread: Re: UIView as opposed to UIViewController...
  • Next by thread: Using audio file services to extract ID3 tags from an incomplete mp3 payload.
  • Index(es):
    • Date
    • Thread