hen*_*dev 55 cocoa-touch cgcontext uisearchbar ios
我在视图中有一个UISearchBar,每当我点击它,键盘出现后 -
后 -(BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar
它将此发送到控制台:
<错误>
CGContextSetStrokeColorWithColor
::无效的上下文0x0
.这是一个严重的错误.该应用程序或其使用的库正在使用无效的上下文,从而导致系统稳定性和可靠性的整体降低.此通知是礼貌的:请解决此问题.它将成为即将到来的更新中的致命错误.
它重复相同的错误.我想知道究竟是什么问题?
我相信有一个NULL上下文,但它与UISearchBar有什么关系?TNX.
Hen*_*ulz 22
这是Apple正在研究的已知问题.应该在下一个测试版中修复.
看看这里:Xcode数字键盘有十进制错误
编辑:对于那些有文本字段问题的人来说,这可能会让你解决:
来自Apple开发者论坛bye Popeye7 - 所以所有的归功于他
我找到了解决这个问题的方法!我有3个应用程序现在已经打破了,所以,对我来说......这是一个很好的发现.在StackOverflow上找到解决方案......将两个答案组合成一个类似的问题.
在我的例子中,用户点击barButtonItem并出现"alert"或对话框.
我看到最大的区别在于如何分配UIAlertView."NEW WAY"让textField显示并调出键盘.
我现在能够看到textField,输入文本,它按照我期望的方式工作.重新添加"initWithFrame"对textField放置没有任何影响.
老路....
- (IBAction)addEntryTapped:(id)sender
{
[_editorTextView resignFirstResponder];
[self saveTextChanges];
[self dismissPopovers];
_prompt = [[UIAlertView alloc] initWithTitle:@"New Entry Title..."
message:@"\n\n\n" // IMPORTANT
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"OK", nil];
_textField = [[UITextField alloc] initWithFrame:CGRectMake(17.0, 55.0, 250.0, 25.0)];
[_textField setBackgroundColor:[UIColor whiteColor]];
[_textField setPlaceholder:@"New Entry Title"];
_textField.borderStyle = UITextBorderStyleRoundedRect;
_textField.autocapitalizationType = UITextAutocapitalizationTypeWords;
_textField.autocorrectionType = UITextAutocorrectionTypeNo;
[_prompt addSubview:_textField];
[_prompt show];
// set cursor and show
[_textField becomeFirstResponder];
}
Run Code Online (Sandbox Code Playgroud)
新方法...
- (IBAction) addEntryTapped:(id)sender
{
[_editorTextView resignFirstResponder];
[self saveTextChanges];
[self dismissPopovers];
_prompt = [[UIAlertView alloc] init];
_prompt.alertViewStyle = UIAlertViewStylePlainTextInput;
UITextField *text = [_prompt textFieldAtIndex:0];
_textField = text;
[_prompt setDelegate:self];
[_prompt setTitle:@"New Entry Title..."];
[_prompt setMessage:@""];
[_prompt addButtonWithTitle:@"Cancel"];
[_prompt addButtonWithTitle:@"OK"];
[_textField setPlaceholder:@"New Entry Title"];
_textField.autocapitalizationType = UITextAutocapitalizationTypeWords;
_textField.autocorrectionType = UITextAutocorrectionTypeNo;
[_prompt show];
// set cursor and show keyboard
[_textField becomeFirstResponder];
}
Run Code Online (Sandbox Code Playgroud)
消息由Popeye7于2013年9月25日下午12:25编辑
消息由Popeye7于2013年9月25日下午12:33编辑
Sta*_*ful 16
从〜/ Library/Preferences中删除iOS模拟器首选项后,这个消失了.
转到〜/ Library/Preferences将"com.apple.iphonesimulator.plist"删除到垃圾箱.
有状态
归档时间: |
|
查看次数: |
19923 次 |
最近记录: |