0
我用這個代碼來做到這一點,但它不工作,把一個問題,那就是IMPOSIBLE從字符串賦值給一個變量如何將UITextField的數據分配給變量?
CODE:
numeroJugador1 = numeroIngresa1.text;
numeroJugador2 = numeroIngresa2.text;
numeroJugador3 = numeroIngresa3.text;
我用這個代碼來做到這一點,但它不工作,把一個問題,那就是IMPOSIBLE從字符串賦值給一個變量如何將UITextField的數據分配給變量?
CODE:
numeroJugador1 = numeroIngresa1.text;
numeroJugador2 = numeroIngresa2.text;
numeroJugador3 = numeroIngresa3.text;
這工作得很好:
NSString *numeroJugador1 = numerIngress1.text;
它不起作用,因爲我在IF中使用變量,並且它帶有錯誤 – 2012-04-12 02:39:29
包括您收到的錯誤和產生該錯誤的代碼。 – bames53 2012-04-12 02:41:28
不兼容的Integrer轉換指針從「UITextField」分配「int」。 – 2012-04-12 02:45:59
...如果numeroJugador變量是整數,並且您試圖將NSString *分配給它們,並且您不能立即理解爲什麼不應該這樣做,那麼您應該可以找到關於編程的書籍或教程(C,C++,或Obj-C;任何將工作)並從頭開始。 – bames53 2012-04-12 02:53:24