                 }
                 else
                 {
-                    upperView = self.targetViews!.objectAtIndex(i - 1) as! NSView
+                    upperView = self.targetViews![i - 1]
                 }
                 
                 make.centerY.equalTo(upperView.snp_centerY).offset(40.0)

        }
    }
    
    func removeTargetView(targetView: TargetView)
    {
        self.targetViews?.removeObject(targetView)
        targetView.removeFromSuperview()
        self.arrangeTargetViews()
    }
}

class PopoverViewController: NSViewController
{
    @IBOutlet var addButton: NSButton!
    var targetViews: Array<TargetView>?
    
    override func viewDidLoad()
    {
        super.viewDidLoad()
        self.targetViews = Array()
    }
    
    func shouldAddTarget() -> Bool
