Dynamic UI with scroll view
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