假设array有5个分数 let array = [98,88,33,22,10] 每次新输入的成绩,如果比最低分高,则取代数列中的某分值的位置 if(newValue!>array[4]){for i in (0..<5){if(newValue!>array[i]){for j in (i+1..<5).reversed(){array[j] = array[j-1]}array[i]
代码如下 if(NSUserDefaults.standardUserDefaults().boolForKey("HasLaunchedOnce")){// app already launched//非首次登陆}else{// This is the first launch ever//首次登陆NSUserDefaults.standardUserDefaults().setBool(tr