fixed crash problem
This commit is contained in:
parent
64a5afb5e0
commit
c590ddd963
7 changed files with 22 additions and 19 deletions
BIN
.DS_Store
vendored
BIN
.DS_Store
vendored
Binary file not shown.
|
@ -223,6 +223,8 @@
|
|||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
||||
|
@ -240,6 +242,8 @@
|
|||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
|
@ -260,7 +264,7 @@
|
|||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = macosx10.6;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
|
@ -272,7 +276,7 @@
|
|||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = macosx10.6;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
|
Binary file not shown.
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
version = "1.3">
|
||||
version = "1.8">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
|
@ -36,7 +36,10 @@
|
|||
displayScale = "1.00"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Debug">
|
||||
buildConfiguration = "Debug"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
|
@ -55,7 +58,8 @@
|
|||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Release">
|
||||
buildConfiguration = "Release"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
|
|
|
@ -9,19 +9,19 @@
|
|||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface SpeakerAppDelegate : NSObject <NSApplicationDelegate, NSSpeechSynthesizerDelegate> {
|
||||
NSWindow *window;
|
||||
NSWindow *__weak window;
|
||||
NSTextView *textView;
|
||||
NSMenu *languageMenu;
|
||||
NSPopUpButton *languageMenuPopupButton;
|
||||
NSMenu *__weak languageMenu;
|
||||
NSPopUpButton *__weak languageMenuPopupButton;
|
||||
NSSpeechSynthesizer *synth;
|
||||
NSRange oldRange;
|
||||
BOOL isNewLocation;
|
||||
}
|
||||
|
||||
@property (assign) IBOutlet NSWindow *window;
|
||||
@property (retain, nonatomic) IBOutlet NSTextView *textView;
|
||||
@property (assign) IBOutlet NSMenu *languageMenu;
|
||||
@property (assign) IBOutlet NSPopUpButton *languageMenuPopupButton;
|
||||
@property (weak) IBOutlet NSWindow *window;
|
||||
@property (strong, nonatomic) IBOutlet NSTextView *textView;
|
||||
@property (weak) IBOutlet NSMenu *languageMenu;
|
||||
@property (weak) IBOutlet NSPopUpButton *languageMenuPopupButton;
|
||||
|
||||
-(IBAction)speakAction:(id)sender;
|
||||
-(IBAction)seekForward:(id)sender;
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
if (string) {
|
||||
NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:string];
|
||||
[[textView textStorage] setAttributedString:attributedString];
|
||||
[attributedString release];
|
||||
NSRange aRange = NSMakeRange([defaults integerForKey:@"startLocation"], 0);
|
||||
[textView setSelectedRange:aRange];
|
||||
[textView scrollRangeToVisible:aRange];
|
||||
|
@ -55,7 +54,6 @@
|
|||
NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@"%@ - %@", country, [dict objectForKey:@"VoiceName"]] action:@selector(changeLanguage:) keyEquivalent:@""];
|
||||
item.tag = i;
|
||||
[self.languageMenu addItem:item];
|
||||
[item release];
|
||||
|
||||
if (![[NSUserDefaults standardUserDefaults] objectForKey:@"languageVoiceIndex"] && [[dict objectForKey:@"VoiceName"] isEqualToString:@"Alex"])
|
||||
{
|
||||
|
@ -117,7 +115,8 @@
|
|||
text = [wholeText substringWithRange:NSMakeRange(range.location, [wholeText length] - range.location)];
|
||||
}
|
||||
|
||||
[synth startSpeakingString:text];
|
||||
[synth stopSpeaking];
|
||||
[synth startSpeakingString:text];
|
||||
|
||||
oldRange = range;
|
||||
|
||||
|
@ -157,9 +156,5 @@
|
|||
[textView setEditable:YES];
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[synth release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
BIN
build/.DS_Store
vendored
Normal file
BIN
build/.DS_Store
vendored
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue