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#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c# - Making TableLayoutPanel Act Like An HTML Table (Cells That Resize Automatically Around Text) -