ios - Scene is unreachable ... does not have an identifier -


i getting warning:

scene unreachable due lack of entry points , not have identifier runtime access via - instaniateviewcontrollerwithidentifier

while xcode correct no entry points, have following defined:

 custom class : class = viewcontrollercatalog identify : storyboard id = vccatalog 

what else need define avoid error?

there 2 ways transition scene in storyboard: can either segue or can instantiate using storyboard identifier. warning pointing out have neither segues nor storyboard identifier, , therefore have no way ever instantiate scene. can instantiate base class, unless use instantiateviewcontrollerwithidentifier, storyboard scene (and of controls , of iboutlet , ibaction references) cannot used. , in order use storyboard method, scene needs storyboard identifier.

so, if you're not going use segues, must mean you're going transition scene programmatically. so, first make sure specify storyboard identifier:

enter image description here

and instantiate detailsviewcontroller linked scene so:

let controller = storyboard!.instantiateviewcontrollerwithidentifier("detailsscene")   // or, if need access custom properties, `storyboard!.instantiateviewcontrollerwithidentifier("detailsscene") as! detailsviewcontroller`  // use see fit, e.g., // // showviewcontroller(controller, sender: self) 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -