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

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -