[Mono-osx] problem casting NSNull to CAAction

Robert Blackadder robblackadder at yahoo.com
Sun Oct 2 20:04:59 EDT 2011


Hello,I need to implement the bit of obj-c code below for mono mac / mono touch.I can't find a way to cast NSNull which needs to be returned in this case.I got -- return (CAAction)NSNull.FromObject(null) -- to compile but crashes at runtime complaining that it can't cast to CAAction

Can someone help please?

-(id<CAAction>)actionForLayer:(CALayer*)layer forKey:(NSString*)key {
    if(layer ==yourLayer)
    {
        if([key isEqualToString:@"contents"])
        {
            return(id<CAAction>)[NSNullnull];
        }
    }
    returnnil;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20111002/d96df979/attachment-0001.html 


More information about the Mono-osx mailing list