iphone - Checking for empty text box -


I have a button and when it has been clicked / tapped, I have to check that there is a value in the text box. If a value is not present then I need a warning button to pop up, the button loads a second view controller which displays the waypoint on a Google map, if no option is in the text box, the Google Map View Controller will notify the waypoints There are problems loading, because it will not know how to request objects from the database.

> I am playing with the code given below:

  - mapButton {if (route.text == NULL) // if (route.text == [NSNull null]) // if ([route.text is aqual: [nsnn tap]]) {mapViewController .sharedMapID = mapID; [Self-current model view controller: animated mapview controller: yes]; } And {UIAlertView * alert = [[UIAlertView alloc] initWithTitle: Zero Message: @ "Please choose a route!" Representative: self cancel buttonTitle: @ "OK" other button titles: zero]; [Alerts show]; [Warning issued]; }  

First of all, it is not that if Wrongly around? I thought that you had said that you wanted UIAlert to be a text if it does not appear (if route.text == null ) ...?

Secondly, have you just tried to check the null instead of the empty string ( route.text.length == 0 )? (Disclaimer - There is no information about iPhone development ...)


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -