Well, I have a UITextField.
Inside it is a property UITextField.text.
Is it ok to do:
// Assume we have UITextField * tf somewhere..
// now set its text..
tf.text = [ [ NSString alloc ] initWithUTF8String:"Init'd with utf8" ] ;
My problem with this is memory. What happens to the old value of the UITextField's text property.
Don't you have to do:
// 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 ] ;
I'm still thinking of memory mgmt as I do in normal C. This might be the flaw here.