protocol IDataSource:AnyObject{
typealias DS;
typealias U;
func dataSource(ds:DS, index:Int?);
func dataSource(ds:DS, data:[U]);
}
class DataSource<T:AnyObject>{
var map = [NSManagedObjectID:T]();
var data = [T]();
var ctrls:NSHashTable = NSHashTable.weakObjectsHashTable();
func find(value:T)->Int?;
var selected:T?;
func setNeedsUpdate<Bar:IDataSource where Bar.U==T,Bar.DS==DSGen>(){
for ctrl in self.ctrls.allObjects {
let client = ctrl as! Bar;
client.dataSource(self, data:self.data);
}
}
func foo(){
// error
setNeedsUpdate()
}
}
How I can call method setNeedsUpdate()? compiler error " Cannot invoke 'setNeedsUpdate' with no arguments"
have found some decision, but decision demand extra parameter