Home › Forums › OpenEars › multiple OpenEars delegates are getting mixed up with ARC on › Reply To: multiple OpenEars delegates are getting mixed up with ARC on
well, i implemented all methods as you have them in tutorial.
Since nil-ing delegate I does not mix controllers anymore, but it still crashes when I go back to VC1 after i used TTS on VC2 and try to make it say:
[self.fliteController say:[txtArr objectAtIndex:hlIndx] withVoice:self.slt];
However it does not crash if I make it say on VC1, go to VC2 and return to VC1 and make it say.
It seems to crash if I make it say on VC2 and return to VC1 and try make it say again.
here is my methods:
-(void)viewWillAppear:(BOOL)animated{
[self.openEarsEventsObserver setDelegate:self];
}
-(void)viewWillDisappear:(BOOL)animated{
self.openEarsEventsObserver.delegate=nil;
}
– (OpenEarsEventsObserver *)openEarsEventsObserver {
if (openEarsEventsObserver == nil) {
openEarsEventsObserver = [[OpenEarsEventsObserver alloc] init];
}
return openEarsEventsObserver;
}
– (FliteController *)fliteController {
if (fliteController == nil) {fliteController = [[FliteController alloc] init];}
return fliteController;
}
– (Slt *)slt {
if (slt == nil) {slt = [[Slt alloc] init];}
return slt;
}
here is bt:
* thread #1: tid = 0x93e1b, 0x0321a3f4 libsystem_c.dylib`strcmp + 84, queue = ‘com.apple.main-thread’, stop reason = EXC_BAD_ACCESS (code=2, address=0x8)
frame #0: 0x0321a3f4 libsystem_c.dylib`strcmp + 84
frame #1: 0x0003d504 AIMExplorer`feat_find_featpair + 84
frame #2: 0x0003d9d4 AIMExplorer`feat_set + 52
frame #3: 0x0003dadd AIMExplorer`feat_set_float + 77
frame #4: 0x0003c759 AIMExplorer`flite_feat_set_float + 57
frame #5: 0x000e897a AIMExplorer`-[FliteController say:withVoice:] + 746
* frame #6: 0x0000dd1f AIMExplorer`-[HighlightAndReadAloudViewController say_hlTxt](self=0x0a3338a0, _cmd=0x00131583) + 223 at HighlightAndReadAloudViewController.m:183
frame #7: 0x0000cc3a AIMExplorer`-[HighlightAndReadAloudViewController buttonHandler:](self=0x0a3338a0, _cmd=0x00130579, sender=0x0a334eb0) + 4186 at HighlightAndReadAloudViewController.m:100
frame #8: 0x02245880 libobjc.A.dylib`-[NSObject performSelector:withObject:withObject:] + 77
frame #9: 0x00ef53b9 UIKit`-[UIApplication sendAction:to:from:forEvent:] + 108
frame #10: 0x00ef5345 UIKit`-[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
frame #11: 0x00ff6bd1 UIKit`-[UIControl sendAction:to:forEvent:] + 66
frame #12: 0x00ff6fc6 UIKit`-[UIControl _sendActionsForEvents:withEvent:] + 577
frame #13: 0x00ff6243 UIKit`-[UIControl touchesEnded:withEvent:] + 641
frame #14: 0x00f34ddd UIKit`-[UIWindow _sendTouchesForEvent:] + 852
frame #15: 0x00f359d1 UIKit`-[UIWindow sendEvent:] + 1117
frame #16: 0x00f075f2 UIKit`-[UIApplication sendEvent:] + 242
frame #17: 0x00ef1353 UIKit`_UIApplicationHandleEventQueue + 11455
frame #18: 0x0243d77f CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
frame #19: 0x0243d10b CoreFoundation`__CFRunLoopDoSources0 + 235
frame #20: 0x0245a1ae CoreFoundation`__CFRunLoopRun + 910
frame #21: 0x024599d3 CoreFoundation`CFRunLoopRunSpecific + 467
frame #22: 0x024597eb CoreFoundation`CFRunLoopRunInMode + 123
frame #23: 0x04b075ee GraphicsServices`GSEventRunModal + 192
frame #24: 0x04b0742b GraphicsServices`GSEventRun + 104
frame #25: 0x00ef3f9b UIKit`UIApplicationMain + 1225
frame #26: 0x0000bbad AIMExplorer`main(argc=1, argv=0xbfffed74) + 141 at main.m:16