Skip to content

Instantly share code, notes, and snippets.

@jenhausu
Created June 9, 2015 13:19
Show Gist options
  • Select an option

  • Save jenhausu/ed68add7cc1b983df827 to your computer and use it in GitHub Desktop.

Select an option

Save jenhausu/ed68add7cc1b983df827 to your computer and use it in GitHub Desktop.
Alert
if (fetchDataArray.count >= 2 || (fetchDataArray.count == 1 && self.sleepData.wakeUpTime > 0) ) {
} else {
[self dontHaveEnoughDataAlert];
footerText = nil;
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationAutomatic];
}
- (void)dontHaveEnoughDataAlert
{
[[[UIAlertView alloc] initWithTitle:@"無法啟用"
message:@"資料不足,最少要有一筆完整的資料"
delegate:self
cancelButtonTitle:@"確定" otherButtonTitles:nil, nil] show];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment