title: How does NSScrollView works?
body: <p>How does <code>NSScrollView</code> works in mac applications? I've write the following code but the scrolling is not working.</p>
  
  <pre><code>NSDictionary *temp=[[ NSDictionary alloc] init  ];
  NSScrollView *scroll = [[NSScrollView alloc ] initWithFrame:CGRectMake(0, 0, 100, 100)];     
  NSArray *dicArray=[NSArray arrayWithObjects:dict,dict1,dict2,dict3,dict4, nil];
  
  for (int i=0; i&lt;[dicArray count]; i++) 
  {
      int offset=100;
      int x=10;
      int y=20;
      y=y+(i*offset);
      temp= [dicArray objectAtIndex:i];
  
      NSRect titleRect=NSMakeRect(x,y,100,30);
      NSRect subtitleRect=NSMakeRect(x, y+20, 400, 20);
  
      NSTextField *title=[[NSTextField alloc] initWithFrame:titleRect];
  
      [[title cell] setStringValue:[temp objectForKey:key]];
  
     [[title cell] setWraps:NO];
     [[title cell] setScrollable:YES];
     [[title cell] setEditable:NO];
     [[title cell] setFont:[NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSMinusSetExpressionType]]];
     [title setDrawsBackground:NO];
     [title setBordered:NO];
  
      NSTextField *subtitle=[[NSTextField alloc] initWithFrame:subtitleRect ];
      [[subtitle cell] setStringValue:[temp objectForKey:subkey]];
      [[subtitle cell] setWraps:NO];
      [[subtitle cell] setScrollable:YES];
      [[subtitle cell] setEditable:NO];
      [[subtitle cell] setFont:[NSFont systemFontOfSize:[NSFont     systemFontSizeForControlSize:NSMiniControlSize]]];
      [subtitle setDrawsBackground:NO];
      [subtitle setBordered:NO];
      [scroll addSubview:title];
      [scroll addSubview:categoryOkButton];
    [scroll addSubview:subtitle];
  
  
  }
  [[self window] setContentView:scroll];
  [scroll release];
  </code></pre>