Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8289881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:37:40+00:00 2026-06-08T12:37:40+00:00

I have a weird problem with a simple NSScrollView on the Mac. I just

  • 0

I have a weird problem with a simple NSScrollView on the Mac. I just started programming in Cocoa, but I had previous experience with UIKit on iOS. I added an NSScrollView to my xib file and subclassed the NSView that was automatically generated by Xcode when I dropped the scroll view in my window. The subclass simply adds content views to the scrollview and draws a background. Here it is:

#import "TweetsView.h"

@implementation TweetsView

- (id)initWithFrame:(NSRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code here.
    }

    return self;
}

- (void)awakeFromNib {

    [self reload];

}

- (void)reload {

    //Retrieve tweets
    ACAccount *account = [[TwitterModel retrieveTwitterAccounts] objectAtIndex:1];
    TwitterModel *model = [[TwitterModel alloc] init];
    NSArray *timeline = [model retrieveMainTimelineWithAccount:account];

    //Display the tweets
    int stackHeight = 0;
    for (NSDictionary *tweetDictionary in timeline) {

        TweetView *tweetView = [[TweetView alloc] initWithFrame:NSMakeRect(0, stackHeight, self.frame.size.width, 60)];
        [tweetView setMainText:[tweetDictionary objectForKey:@"text"]];
        [self addSubview:tweetView];

        stackHeight += (int)tweetView.frame.size.height;
    }
    self.frame = NSMakeRect(self.frame.origin.x, self.frame.origin.y, self.frame.size.width, stackHeight);

}

- (void)drawRect:(NSRect)dirtyRect
{

    [[NSColor colorWithCalibratedRed:0.96 green:0.96 blue:0.96 alpha:1.0] setFill];
    NSRectFill(dirtyRect);

    [super drawRect:dirtyRect];

}

- (void)setTweets:(NSArray *)tweets {
    _tweets = tweets;
}

- (NSArray *)tweets {
    return _tweets;
}

@end

When I run this program the scroll view will display just normal but I can’t scroll it with my trackpad. The scrollbars don’t appear either. When I resize the window the scrollbars appear for a second just like they normally do in a Cocoa application, and if I’m quick I can scroll by dragging the scroll bars then. So I think the Scroll View does exist, but it doesn’t respond to my mouse and gestures.

What am I doing wrong here? I’m running Mountain Lion and Xcode 4.4 and there are no views in front of the scroll view.
Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T12:37:42+00:00Added an answer on June 8, 2026 at 12:37 pm

    Apparently the document view of my scroll view was a subclass of NSScrollView which is obviously wrong. I changed it to a subclass of NSView and now the problem is fixed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just started with media wiki but i have a weird problem. I want to
a possibly simple problem, but weird why I have no idea how to do
Very simple problem...but weird results. Im just trying to fill a drop down list
I have a weird problem. I create this window, but its blank until i
I have weird problem with zend framework basics. I have simple action in IndexController:
I know how to use RVM, but now I have a weird problem, which
i have a weird problem with my local Testing-Setup of a simple Java URL
I have a weird problem , below are two simple get calls and returning
I have a weird problem. I have a simple function to open a popup
it's a weird problem that I have I have a very simple constructor that's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.