objective c - Dynamically change the textview.keyboardType using segment control -


-(void)segmentaction {   if(segmentedcontrol.selectedsegmentindex == 0)   {       textview.keyboardtype = uikeyboardtypenumberpad;   }   else   {       textview.keyboardtype = uikeyboardtypedefault;   } } 

this objective c/iphone question.

is function 'segmentaction' hooked segmentedcontrol in interface builder ? make sure gets called, instance, on 'valuechanged' segmented control, , should change keyboard.

either segmentaction needs ibaction or needs called one.

make sure segmentedcontrol hooked up, iboutlet.

also, 'textview' coming from. textview delegate functions return variable called textview, if member variable called textview things going confusing you.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -