Generic function with AnyObject fails -


i'm trying use generic function i'm getting segmentation fault.

i'd simplify handling of restkit results creating generic function handle all. function cast array of result desired type, , call callback.

here's code

class func handlerestkitresult<t:anyobject>(mappingresult:rkmappingresult!,callback:([t])->void){     var resultarray = mappingresult.array();      if (resultarray [t]){         callback(resultarray [t])     } } 

seems have no errors. when run it, segmentation default, , handlerestkitresult<t:anyobject>.

specifically anyobject part. if remove however, warning t not conform anyobject.

am missing here?

i'm know theres way can pass name of class/type string, , sort of magic. i'm still wondering whats going wrong here.

thanks :)


Comments

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -