开发者

I send a parameter to method but it always returns null

In Objective-C I send a parameter to method but it always returns null.

My code:

-(IBAction) clickNumero: (id) sender
{   
    NSString *num = [(UIButton *)sender currentTitle];
    float numFloat = [num floatValue];
    [self verificarOperador:(float)nu开发者_运维知识库mFloat];
}

-(float) verificarOperador:(float)valor
{   
    return valor;
}


Are you sure -currentTitle is returning a numeric string only? You should add NSLog(@"Button Title: %@", num); to make sure.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜