1. When judging whether a string is null, you must write the string! = Nil The first time
Strangely, the null value passed through is always verified.
Looked up some information, found that if you call the service class remotely, get null values need to judge
if
([string isKindOfClass:[
NSNull
class
]]){
}
2. When you use the Textfiled control to enter something, you often limit the length of some input characters we can use the following method-(BOOL) TextField: (Uitextfield *) TextField Shouldchangecharactersinrange: (nsrange) Range replacementstring: (NSString *) string
{
int maxlen = 5; Limit length to--5
nsstring* Text = [Phonetext text];
if ([Phonetext length]> MaxLen)
{
Phonetext.text = [text Substringtoindex:maxlen]; The important thing is this sentence
}
}
ios--determine the string null and how to limit the input length of the textfiled