Hello all
What is the best code to use to test whether a text field contains any value? I've current got the following and its working, albeit I'm not sure if there is a better way:
Furthermore, if it does contain a value what is the best way to test to see if it is numeric?
Finally, and this is a question that is unrelated to the title but I just want to slip it in as well; I have the following statement to assign a Yes value to a boolean variable I have declared. After building my programme I have a warning against it which reads "Assignment makes pointer from integer without a cast":
Does it have something to do with YES being the same as a 1 and NO being the same as 0?
Thanks for any assistance.
What is the best code to use to test whether a text field contains any value? I've current got the following and its working, albeit I'm not sure if there is a better way:
Code:
if (purchasePrice.text==nil || purchasePrice.text.length==0)
Furthermore, if it does contain a value what is the best way to test to see if it is numeric?
Finally, and this is a question that is unrelated to the title but I just want to slip it in as well; I have the following statement to assign a Yes value to a boolean variable I have declared. After building my programme I have a warning against it which reads "Assignment makes pointer from integer without a cast":
Code:
errorFound=YES;
Does it have something to do with YES being the same as a 1 and NO being the same as 0?
Thanks for any assistance.