2013-04-01 145 views
1

我需要创建UITextField作为我从Service获取的字符串的名称。 我尝试以下方法类型铸造uitextfield在montouch?

string name = "Sample"; 
UITextField name = new UITextField(); 

,但我发现已经定义的数据类型的错误。

请给我解决方案。

先谢谢您,

回答

2

您不能有两个相同的变量。这是一个普通的C#语法问题。

请问,如果你做到这一点的工作:

string name = "Sample"; 
UITextField nameField = new UITextField(); 
+0

雅 字符串名称= “样本”; UITextField nameField = new UITextField(); 它会工作 – Sri

+0

如果这解决了你的问题,一般人upvote答案或标记为解决。只是注意到你似乎对stackoverflow新。 – jonathanpeppers