views:

67

answers:

3
+1  Q: 

How to typecast ?

Sir,

I have used the below function

while(labelZ.text!=0)

but getting the typecast error.

A: 

Try this

while((int)labelZ.text!=0)
Sri Kumar
+1  A: 

Use nil instead of 0.

KennyTM
+2  A: 

To check if a string is not set, use:

labelZ.text == nil

To check if a string is an empty string, use:

[labelZ.text isEqualToString:@""]

To check if a string equals "0", use:

[labelZ.text isEqualToString:@"0"]
Florian