Cannot invoke initializer for type 'AnyObject?' with no arguments

痴心易碎 提交于 2019-12-20 06:07:11

问题


I am using swift 3 to build a type of chat messenger. To store loggedIn Users, I try to use an onject of type AnyObject.

    var loggedInUser = AnyObject?()

And it gives the following error: ViewController.swift:29:24: Cannot invoke initializer for type 'AnyObject?' with no arguments

来源:https://stackoverflow.com/questions/39515792/cannot-invoke-initializer-for-type-anyobject-with-no-arguments

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!