我今天遇到了一系列autoconf宏:https://www.gnu.org/software/autoconf-archive/The-Macros.html#The-Macros。所有都以ax_
为前缀,例如ax_ac_append_to_file.m4
,configure.ac
已在AX_ABSOLUTE_HEADER()
中激活,其中包含行AC_
。
过去,我只看到以AX_
开头的宏。
切换到if currentArea != "Somewhere" {
if gettingContent == false && objectsArray.count == 0 {
if firstOfLocalLeaderboard != nil {
if indexPath.row == 0 {
let vc = self.storyboard!.instantiateViewController(withIdentifier: "TopTenAreaController") as! TopTenAreaController
vc.area = currentArea
let navVC = UINavigationController()
navVC.viewControllers = [vc]
self.present(navVC, animated: true, completion: nil)
}
else if indexPath.row == 1 {
if localLeaderboard.count > 0 {
let vc = self.storyboard?.instantiateViewController(withIdentifier: "PhotoViewController") as! PhotoViewController
vc.objectsArray = localLeaderboard
vc.currentArea = currentArea
let navVC = UINavigationController()
navVC.viewControllers = [vc]
self.present(navVC, animated: true, completion: nil)
}
else {
let vc = self.storyboard!.instantiateViewController(withIdentifier: "CameraViewController") as! CameraViewController
vc.appearedFromHome = true
let navVC = UINavigationController()
navVC.viewControllers = [vc]
self.present(navVC, animated: true, completion: nil)
}
}
}
else {
if indexPath.row == 0 {
if localLeaderboard.count > 0 {
let vc = self.storyboard?.instantiateViewController(withIdentifier: "PhotoViewController") as! PhotoViewController
vc.objectsArray = localLeaderboard
vc.currentArea = currentArea
let navVC = UINavigationController()
navVC.viewControllers = [vc]
self.present(navVC, animated: true, completion: nil)
}
else {
let vc = self.storyboard!.instantiateViewController(withIdentifier: "CameraViewController") as! CameraViewController
vc.appearedFromHome = true
let navVC = UINavigationController()
navVC.viewControllers = [vc]
self.present(navVC, animated: true, completion: nil)
}
}
}
}
是一个相对较新的约定,一种避免命名空间冲突的方法,还是别的什么?
答案 0 :(得分:2)
宏是命名空间。 AC_
是指来自Autoconf的宏,AM_
是Automake,LT_
是Libtool等。
过去,提供宏的其他程序在Autoconf的命名空间中占据一席之地是很常见的,这就是为什么你可能已经看到了AX_
宏的一些AC_
宏的变体。{{ 1}}前缀。