开发者

UITextField text property returns random integer

开发者 https://www.devze.com 2022-12-29 02:04 出处:网络
When I try to get the text of a UITextField it returns a random integer. Here\'s the code I used: NSLog(@\"Field Text: %d\", field.text);

When I try to get the text of a UITextField it returns a random integer. Here's the code I used:

NSLog(@"Field Text: %d", field.text);

field being the UITextFi开发者_JS百科eld. And in the debugger it returns an random number, for example 29876208 when there is text in the UITextField.


Euhm, I think you are either getting back some kind of representation of the memory address the text is located, or just some bull-sh*t.

You should try to do this:

NSLog(@"Field text : %@", field.text);

The problem is the formatter you are using.

0

精彩评论

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