データの保存と取得に Core Data を使用するアプリを開発しています。
ホーム画面のアプリのアイコンにバッジ番号を追加したいのですが、いくつか問題があります...次の
コードを試しました:
NSInteger section = [self.tableView numberOfSections];
id <NSFetchedResultsSectionInfo> sectionInfo = [[self.fetchedResultsController sections] objectAtIndex:section];
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:[sectionInfo numberOfObjects];
このコードは機能しませんが、これを行う方法がわかりません...
どのコードをどこに書く必要がありますか? AppDelegate または RootViewController 内? そして、どの方法で?
助けてくれてありがとう!