             //ボタンを配置する
             self.view.addSubview(button)
             self.view.bringSubviewToFront(button)
+            
+            buttonobjectarray.append(button)
         }
     }
     

        self.ShowAllData(CommonMethod().Changecalendar(currentnsdatesplit.year, calender: "A.D"), m: currentnsdatesplit.month, d: currentnsdatesplit.day)
        CalenderLabel.text = "\(currentnsdatesplit.year)年\(currentnsdatesplit.month)月\(currentnsdatesplit.day)日 (\(self.ReturnWeekday(currentnsdatesplit.weekday)))"
        
    }
    
    //受け取った文字列をシフト体制に分別して返す

    }
    
    var buttontilearray:[String] = []
    var buttonobjectarray: [UIButton] = []
    
    func SetupDayButton(){
        
        for i in 0..<buttonobjectarray.count {
            buttonobjectarray[i].removeFromSuperview()
        }
        
        //ボタンのタイトルを日付から計算して生成する
        let todaynsdate = self.ReturnYearMonthDayWeekday(currentnsdate)
        self.SetDayArray(currentnsdate,pivotweekday:todaynsdate.weekday)      //buttontilearrayへ値を格納する
        
        for i in 0...6{
            
