我有一个UITextView在UIViewController.其中UITextView,需要为备注插入多个CheckBox.
如何创建多个checkBox?
I have created Multiple CheckBoxes for `UIButton` Click, But When I Select or DeSelect operation, all ChecKBoxes Value changes.
Run Code Online (Sandbox Code Playgroud)
如何动态创建多个checkBox并为这些CheckBox创建方法?
可能吗?
这是我的代码:
-(void)Check
{
CGPoint origin = note.frame.origin;
NSString* head = [note.text substringToIndex:note.selectedRange.location];
CGSize initialSize = [head sizeWithFont:note.font constrainedToSize:note.contentSize];
NSUInteger startOfLine = [head length];
NSString* tail = [head substringFromIndex:startOfLine];
CGSize lineSize = [tail sizeWithFont:note.font forWidth:note.contentSize.width lineBreakMode:UILineBreakModeWordWrap];
CGPoint cursor = origin;
cursor.x += lineSize.width+15;
cursor.y += initialSize.height - lineSize.height-130;
checkbox = [[UIButton alloc] …Run Code Online (Sandbox Code Playgroud)