Would arrayOfViews ever not contain a button that has the priorityWasClicked: action?
[arrayOfViews indexOfObject:sender] would be quite a bit simpler to read