Eh bien, j'ai un UITextField.Gestion de la propriété UITextField.text
À l'intérieur, il s'agit d'une propriété UITextField.text.
Est-il autorisé à faire:
// Assume we have UITextField * tf somewhere..
// now set its text..
tf.text = [ [ NSString alloc ] initWithUTF8String:"Init'd with utf8" ] ;
Mon problème est la mémoire. Que se passe-t-il à l'ancienne valeur de la propriété de texte UITextField.
Ne pas que vous devez faire:
// maintain reference to old NSString
NSString * oldTfText = tf.text ;
// set the value to the new value you want
tf.text = [ [ NSString alloc ] initWithUTF8String:"Init'd with utf8" ] ;
// release the old NSString now..
[ oldTfText release ] ;
Je pense toujours à Mgmt mémoire comme je le fais dans des conditions normales C. Cela pourrait être le défaut ici.