最近使用xcode13創建了個新項目,iOS13后項目可以使用SceneDelegate,但是在使用QQ登錄時,遇到了qq授權登錄后TencentLoginDelegate無法執行,費勁吧啦整了一天各種嘗試后,發現使用SceneDelegate就會實例化TencentOAuth對象異常
TencentOAuth * tencentOAuth = [[TencentOAuth alloc] initWithAppId:appid
andUniversalLink:link
andDelegate:tencentMgr];
這里的'tencentOAuth'對象里的屬性都是nil,導致授權回調后TencentLoginDelegate無法執行,最后刪除了SceneDelegate才正常(如何刪除SceneDelegate可自行查詢),具體深層的原因如有大佬知道感謝告知,或者有更好的處理方法可以建議。