草庐IT

Section_SectionName_TextField

全部标签

ios - 返回值对 UI TextField 委托(delegate)方法 textFieldShouldReturn :? 意味着什么

苹果文档提供:Asksthedelegateifthetextfieldshouldprocessthepressingofthereturnbutton.-(BOOL)textFieldShouldReturn:(UITextField*)textFieldParameterstextFieldThetextfieldwhosereturnbuttonwaspressed.ReturnValueYESifthetextfieldshouldimplementitsdefaultbehaviorforthereturnbutton;otherwise,NO.DiscussionThet

cocoa-touch - 在索引 501 处获取的对象有一个乱序的部分名称 'JOURNAL OF APPLIED PHYSICS. Objects must be sorted by section name'

我有一个包含期刊章节名称的文章数据库。一篇是《JournalofAppliedPhysics》,一篇是《JOURNALOFAPPLIEDPHYSICS》。当我使用[[NSSortDescriptoralloc]initWithKey:@"Journal"ascending:YESelector:@selector(caseInsensitiveCompare:)]要获取数据,它会给我错误消息。Thefetchedobjectatindex501hasanoutofordersectionname'JOURNALOFAPPLIEDPHYSICS.Objectsmustbesortedby

iphone - 如何动态添加Section和TableView Cell

我有一个按钮,当按下该按钮时,将添加一个tableview部分,并且还会向该部分添加一个新行。我如何以编程方式实现它?我有一个单元格数组。这是我的代码-(IBAction)addCell:(id)sender{UITableViewCell*newCell=[[UITableViewCellalloc]init];counter++;[cellsaddObject:newCell];[self.tableViewreloadData];}-(NSInteger)numberOfSectionsInTableView:(UITableView*)tableView{return[cell

ios - UITableView 的 "attempt to delete section"断言失败

我正在尝试使用以下代码更新UITableView:NSMutableIndexSet*sectionsToDelete=[NSMutableIndexSetindexSet];NSMutableIndexSet*sectionsToInsert=[NSMutableIndexSetindexSet];NSMutableIndexSet*sectionsToReload=[NSMutableIndexSetindexSet];/*...*/[[selftableView]beginUpdates];if([sectionsToReloadcount]){DBGLogObject(sect

ios - 在iOS中获取textfield.text时将textfield的值更改为另一种语言

当我得到mytextfield.text时,结果是这样的:“1234”,这是一个波斯数字“1234”。我有一个将波斯文本转换为英文文本的方法。我想在使用mytextfield.text获取文本时获取英文文本解决方案1:我可以意识到当用户更改文本字段时,我可以将其更改为我想要的。但是它的性能不好,因为用户可能想多次更改它我只想在我想得到它的时候转换它。 最佳答案 如何创建UITextField的子类并覆盖.text?在你的.h文件中#import@interfaceTranslatingTextField:UITextField@en

iphone - NSFetchedResultsController 错误 : 'NSInternalInconsistencyException' , 原因: 'no object at index 1 in section at index 0'

我有一个使用tableview和NSFetchedResultsController的应用程序。我收到错误:Seriousapplicationerror.ExceptionwascaughtduringCoreDatachangeprocessing.ThisisusuallyabugwithinanobserverofNSManagedObjectContextObjectsDidChangeNotification.Terminatingappduetouncaughtexception'NSInternalInconsistencyException',reason:'noob

ios - 覆盖 TextField 中的 VoiceOver 消息 - iOS 辅助功能

我有一个包含“下午24英镑”的UITextField,但我希望画外音说“每月24英镑”。通过设置:[textViewsetAccessibilityLabel:@"£24permonth"];VoiceOver读出“每月24英镑,下午24英镑”。如何停止读出UITextField中的消息? 最佳答案 您应该设置可访问性标签来描述文本字段(就好像它是一个键)及其值的可访问性值。textField.accessibilityLabel=NSLocalizedString(@"Price",nil);//textField.accessi

ios - 从 textField 中选择粗体和斜体文本

如何只选择用户在textField/textView中输入的粗体和斜体文本?我们可以将选定的文本设为粗体、斜体、下划线以及这三者的任意组合,但反之亦然。*这不是特定于MacOSX或iOS,任何一种解决方案都适合我。编辑:我尝试将属性字符串中的文本读取为:NSAttributedString*string=self.textView.string;但是当textView和textField返回NSString时,所有格式都消失了。 最佳答案 在iOS上使用带标签/文本字段的attributedText属性在OSX上使用attribut

ios - 如何检测 SwiftUI 中 TextField 的实时变化?

我有一个像这样绑定(bind)到状态“位置”的简单TextField,TextField("SearchLocation",text:$location)每次这个字段改变时我想调用一个函数,像这样:TextField("SearchLocation",text:$location){self.autocomplete(location)}但是这不起作用。我知道有回调,onEditingChanged-但这似乎只有在聚焦字段时才会触发。如何让这个函数在每次字段更新时调用? 最佳答案 您可以使用自定义闭包创建绑定(bind),如下所示:

php - 带有复杂 $textField 的 CHtml::listData

我想使用模型中的几个属性作为textField。像这样:$form->dropDownList($formModel,'ref_attribute',CHtml::listData(User::model()->findAll(array('order'=>'attribute1ASC,attribute2ASC')),'id','attribute1attribute2(attribute3)'),array());以便'attribute1attribute2(attribute3)'自动转换为正确的属性值。我试过“按原样”编写它('attribute1attribute2(att