ios - Swift: Missing Strange Parameter -


i made method in viewcontroller class called refresh.

i call refresh view controller of view presented modally on default view. however, although method refresh takes in no parameters, xcode telling me missing argument parameter #1 in call during call method. call method this: viewcontroller.refresh()

if press esc in between parantheses of method call, xcode tells me put in viewcontroller. however, if run that, xcode gives me 2 errors:

expression resolves unused function editor placeholder in source file 

is because secondary view controller in folder doesn't contain primary view controller?

update: here refresh method:

self.getsortedsectionlist() self.tableview.reloaddata() 

self.getsortedsectionlist() this:

//first, clear events sectionlist     sectionlist = [int: [event]]()     //loop through eventlist array , seperate different event starting times     index in 0..<viewcontroller.eventlist.count {         let event = viewcontroller.eventlist[index]         if var arr = sectionlist[event.starttime!] {             //if there @ least 1 value there, add onto array             arr.append(event)             sectionlist[event.starttime!] = arr         } else {             //otherwise nil, create array             let arr: [event] = [event]             sectionlist[event.starttime!] = arr         }     }     sortedkeys = array(sectionlist.keys).sort(<) 

i assume viewcontroller class name of controller , refresh not static method. should call refresh() using object of controller, not class.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -