• 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
Dynamic UI with scroll view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dynamic UI with scroll view


  • Subject: Dynamic UI with scroll view
  • From: Erik Buck <email@hidden>
  • Date: Tue, 28 Jul 2009 07:44:08 -0700 (PDT)

NSLog(@"%@", [scrollView documentView]); //outputs (null)

What does NSLog(@"%@", scrollView ); tell you ?

// the following is a memory leak if you are not using garbage collection
[scrollView setDocumentView:[[NSView alloc]  initWithFrame:NSMakeRect(0, 0, 500, 500)]];

Try
[scrollView setDocumentView:[[[NSView alloc]  initWithFrame:NSMakeRect(0, 0, 500, 500)] autorelease]];

If scrollView is not nil, the above code will do what you want except that an instance of plain NSView doesn't draw anything so the scroll view will look empty with scroll bars appropriate for a 500 by 500 document view.
_______________________________________________

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: Re: NSTextView - NSAttributedString paragraph style attributes
  • Next by Date: Re: Dynamic UI with scroll view
  • Previous by thread: Re: Dynamic UI with scroll view
  • Next by thread: NSString and regular expressions
  • Index(es):
    • Date
    • Thread