开发者

iPhone -> problem with UITextfield and NSString -> null value

开发者 https://www.devze.com 2023-02-10 11:35 出处:网络
I have an iPhone application and a proble开发者_StackOverflowm with Strings and UITextfields. I have this in viewDidLoad::

I have an iPhone application and a proble开发者_StackOverflowm with Strings and UITextfields.

I have this in viewDidLoad::

NSLog(@"1: %@", self.myObject.myNSStringProperty);
self.aUITextFieldProperty.text = self.myObject.myNSStringProperty;
NSLog(@"2: %@", self.aUITextFieldProperty.text);

The output is:

2011-02-13 22:07:32.570 myProject [85241:207] 1: StringTest
2011-02-13 22:07:32.570 myProject [85241:207] 2: (null)

Why is the second output null?

Best Regards, Tim.


Blind guess: because aUITextFieldProperty is nil.

0

精彩评论

暂无评论...
验证码 换一张
取 消