Search code examples
iosuibutton

Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN


When I'm clicking button I'm getting this exception.I don't know where I'm doing wrong Someone help me .my app is rejected because of this exception my code:

 UILabel *rememberMeLabelObj = [[UILabel  alloc]initWithFrame:CGRectMake(xaxisForRememberMeLabel, yaxisForRememberMeLabel, widthForRememberMeLabel, heightForRememberMeLabel)];
rememberMeLabelObj.text = @"Remember me";
rememberMeLabelObj.font =[UIFont systemFontOfSize:14.0];

rememberMeLabelObj.textColor = [UIColor colorWithRed:0.816f green:0.592f  blue:0.157f alpha:1.00f];
[self.view addSubview:rememberMeLabelObj];

Solution

  • I solved my issue actually I didn't gave float values because of this I got exception.I gave CGFloat and gave values as integer like 400,350,etc but I need give 400.0f .so,I got this issue .Now it was cleared