ios - Cannot invoke initializer for type 'MCNearbyServiceAdvertiser' -
working on ios multipeer connectivity, after updating swift 2.0, facing issue following codes:
var advertiser:mcnearbyserviceadvertiser! var peer:mcpeerid! func startendadvertising(value:bool) { if advertiser == nil { var someobject: [string : anyobject] = ["profilename" : datacentral.getinstance.userpeervo.peername] advertiser = mcnearbyserviceadvertiser(peer: peer, discoveryinfo: someobject, servicetype: "shadow-chat") advertiser.delegate = self } }
this following line generates error "cannot invoke initialiser type 'mcnearbyserviceadvertiser' argument list of type '(peer: mcpeerid!, discoveryinfo: [string : anyobject], servicetype: string)'"
advertiser = mcnearbyserviceadvertiser(peer: peer, discoveryinfo: someobject, servicetype: "shadow-chat")
Comments
Post a Comment