Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Equivalent to a "ListBox" in XCode?

You know Visual Studio, that awesome element called "ListBox"? Just a box that would list a bunch of strings.

I am now working with XCode, and I found this class in the interface builder "NSScrollView". It seems to be able to list me a couple strings. It says it got a NSTextView inside, but, how do I access it?

I am not even sure if NSScrollView is the correct solution I need, but if I could simply access the NSTextView inside it, I think it would be enough.

like image 997
Voldemort Avatar asked Jun 14 '11 02:06

Voldemort


2 Answers

See NSTableView.

As for getting to a text view inside a scroll view, create an Interface Builder outlet (IBOutlet) and connect it to the text view itself, rather than the scroll view.

like image 58
Joshua Nozzi Avatar answered Nov 10 '22 00:11

Joshua Nozzi


To get to a text view inside a scroll view; you need to select the controller with your outlet defined; click and hold control and then drag the blue connection line from your controller to the top line of the scroll view; then just wait for a blue line to appear; this will then prompt to let you link your outlet to the text view.

like image 38
alban Avatar answered Nov 10 '22 00:11

alban