I'm trying to convert an NSInteger to a NSString to show the NSInteger value in a UIAlerView. But the problem is that I get this error: "Bad receiver type 'NSInteger' (aka 'long')" when I'm trying to convert the NSInteger.
The NSInteger:
NSInteger clasesDadas = clases.count;
The clases.count is the number of rows I have in the TableView.
The code is:
-(void)infoAction
{
NSInteger clasesDadas = clases.count;
NSString *inStr = [NSString stringWithFormat:@"%d", [clasesDadas intValue]]; /*HERE IS THE ERROR*/
UIAlertView *alertatiempo = [[UIAlertView alloc] initWithTitle:@"Información" message:inStr delegate:self cancelButtonTitle:@"Aceptar" otherButtonTitles:nil];
[alertatiempo show];
}
Can anyone help me? Thank you very much.