Well, finally, I realized - neali.
I don't know yet which part was wrong. Finally, I found out that the problem is with the UITextView. The original text view was not intended for editing. But I wanted to receive sensory events. so I turned to one of the tips: (iPhone) How to handle strokes in a UITextView? I assigned "self" (a subclass of UIViewController) as a UITextView delegate and barely executed the protocol this way:
- (BOOL)textViewShouldBeginEditing:(UITextView *)textView{ [self userShow:nil]; //Within this method a subsequent UIViewController subclass/object is created and pushed. return FALSE; } - (BOOL)textViewShouldEndEditing:(UITextView *)textView{ return TRUE; } - (void)textViewDidBeginEditing:(UITextView *)textView{ return; } - (void)textViewDidEndEditing:(UITextView *)textView{ return; } - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text{ return TRUE; } - (void)textViewDidChange:(UITextView *)textView{ return; } - (void)textViewDidChangeSelection:(UITextView *)textView{ return; }
The goal was to actually avoid editing, but to get an event when the user touches the UITextView area and triggers some action. In this case, the following view controller was created and added to the navigation stack. It worked fine, but after a while, in some cases minutes (!), The application crashed. Thanks to the answer from Lou and his blog, I was able to get EXC_BAD_ACCESS much closer to calling textViewShouldBeginEditing. Like an early departure from EXC_BAD_ACCESS, I commented on a UITextView and called the view controller, which is called using another UIButton element. (Just a quick workaround) Fortunately, this did the trick. The app no longer crashed. Now I will move on to a more complex implementation, which will bring the same user interface, but will call another view controller to another, but save.
I provide this answer in case anyone else comes across the same question. If you have an explanation as to which part exactly caused the problem, then your punch is much appreciated.
source share