매개 변수가 UIViewController이어야하는 경우가 있습니다! 제대로 objc에서 매핑 할 수 있지만 슬프게도 UIViewController입니다. Apple API fsckup : 어떻게 신속하게 unsafepointerof 0 a.k.a. NULL/0x0을 만드나요?
이
func pageViewController(pageViewController: UIPageViewController, viewControllerAfterViewController currentVC: UIViewController) -> UIViewController? {
guard unsafeAddressOf(currentVC).hashValue != 0 else { // 31316097 filed with apple
는 조금 깨지기 쉬운 느낀다. hashValue는 0x0 이외의 포인터에 대해 0으로 매핑 될 수 있습니다. unsafeAddressOf (currentVC)를 NULL과 비교하는 안전하지 않은 포인터를 어떻게 만들 수 있습니까?
스위프트 2.3의 경우 일반형이므로 신속한 2와 함께 할 수 있지만 그만큼 신속하게 만들었습니다. 3! 답변의 종류가 필요합니다.
Swift에는 'NULL'이 (가) 없습니다. 'nil'은'Optional .none'의 줄임말입니다. –
Alexander