iphone SDK: How to check user set up a valid IP , Netmask , Router ???

Posted by WebberLai on Stack Overflow See other posts from Stack Overflow or by WebberLai
Published on 2011-03-14T08:06:01Z Indexed on 2011/03/14 8:10 UTC
Read the original article Hit count: 303

Filed under:
|
|
|
|

It is simple to understand after this pic.

enter image description here

I add fewtextfields in tableview

I already set the keyboard style is number pad.

Now the problems is

1.Do I need to create 12 textfields ???ex. UITextField *ip1,ip2,ip3,ip4....or just set different tag for textfield ?

2.How to check user enter wrong char not 3 valid numbers

(even the keyboard is set number pad,but it might can paste words...)

3.How to check user did follow this setting rules ???

<1>If IP1 is 0~223 , IP2 need to be set 0~255,IP3,IP4 both are 0~255

<2>If IP1 is 172 ,IP2 is set 16~31.IP3,IP4 both are 0~255; If IP1 is 192 ,IP2 must be 168.IP3 IP4 are 0~255

<3>Netmask set default 255.255.255.0

<4>Router 0~223 ,0~255 ,0~255 ,0~255

This IP setting rules is my friends tech me this ...I not sure the rules is right or not?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about ios