compare NSString and integer?

I have a string that I need to compare with an integer value.

I did this so far :

NSString *rad = [NSString stringWithFormat: @"%@", combo.selectedText];
srchParam.radius = rad;
if (srchparam.radius > 5)
    //code here

What am I doing wrong ?


Try this:

if ([combo.selectedText intValue] > 5) {
   //code here

Need Your Help

Retrieve latest timestamp row from table using INNER JOIN

php mysql sql

want to retrieve the latest timestamp of the row of name from table. However only the table "location" has the timestamp.