I have a UITextview in my Screen,I created textview in drag and drop on screen, now i want to add button to last (end of the text in text view )of the textview then how can i do that ??
i have been try
[super viewDidLoad];
SelectInvestiList = [[NSMutableArray alloc] initWithCapacity:[InvestiList count]];
AppDelegate *appDeleg = (AppDelegate *)[[UIApplication sharedApplication]delegate];
textViewInvest.text=nil;
UIButton*button=[UIButton buttonWithType:UIButtonTypeRoundedRect];
[button setFrame:CGRectMake(0, 0, 30, 30)];
[button setTitle:@"test" forState:UIControlStateNormal];
[textViewInvest addSubview:button];
NSMutableString *prev=[[NSMutableString alloc] init];
if (appDeleg.chiefCompText != nil) {
prev=(NSMutableString *) textViewInvest.text;
[prev appendString:(NSMutableString *) appDeleg.chiefCompText];
textViewInvest.text=[prev capitalizedString];
}
if (appDeleg.vitalText != nil) {
prev=(NSMutableString *)textViewInvest.text;
[prev appendString:(NSMutableString *) appDeleg.vitalText];
textViewInvest.text=[prev capitalizedString];
}
but that not work ..