简体   繁体   中英

NSMatrix has too many buttons?

I'm trying to make a radio button set with two options, "Single" and "Sweep". I dragged a radio button into my storyboard and then added it to a matrix using Editor->Embed in. I then changed the number of rows to two.

I see two radio buttons in the IB display, the Inspector says there's two rows, and when I run it I only see two buttons. However, there are three buttons in the hierarchy display:

在此处输入图片说明

It seems the second one named "Single" is real, when you click on the lines in the left pane you can see a shadowed selection appear in the same place as the first button. I tried everything I could to delete that entry, but nothing seems to work.

This may simply be a IB bug that I should report, but I'm not sure I simply didn't do something wrong in setting this up. Anyone else seen anything like this?

The first cell under the matrix in the document outline is the prototype cell. From the NSMatrix Class Reference :

The prototype cell that's copied whenever the matrix creates a new cell.

NSMatrix has a bunch of methods like addRow and insertColumn: that make copies of the prototype.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM