我正在开发一款TextToSpeech应用.我在a中写了一段UITextField,然后按下Speak按钮.声音根据文中所写的文字播放UITextField.

但是,当应用程序处于后台模式时,音频将停止播放.如何在后台模式下继续播放声音?类似于音频播放器如何在后台播放歌曲.
我使用以下代码进行文本到语音转换:
#import "ViewController.h"
#import "Google_TTS_BySham.h"
#import <AVFoundation/AVFoundation.h>
@interface ViewController ()
@property (nonatomic,strong)Google_TTS_BySham *google_TTS_BySham;
@property (nonatomic,strong)IBOutlet UITextField *txtString;
@end
@implementation ViewController
#pragma mark - View Life Cycle
- (void)viewDidLoad {
[super viewDidLoad];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
#pragma mark - Button Tapped event
- (IBAction)btnSpeakTapped:(id)sender{
NSString *str = [NSString stringWithFormat:@"%@",_txtString.text];
self.google_TTS_BySham = [[Google_TTS_BySham alloc] init];
[self.google_TTS_BySham speak:str];
}
Run Code Online (Sandbox Code Playgroud) 我在尝试使用 Facebook 登录时收到以下错误
由于未捕获的异常“InvalidOperationException”而终止应用程序,原因:“fb---AppID---未注册为 URL 方案。请将其添加到您的 Info.plist'
问题是“fb---AppID---”位于我的 Info.plist 文件中。我遵循了此处显示的 FB 文档中列出的 3 个要点。
我直接从文档中复制了应用程序名称和应用程序 ID。我究竟做错了什么?文档中是否缺少步骤?是我在其他地方没有正确配置吗?

我在iAd/AdMob广告中放置了我的代码...
-(void)viewWillAppear:(BOOL)animated{}
Run Code Online (Sandbox Code Playgroud)
广告的工作方式非常好,就像我现在在所有iOS设备上使用它们一样.当我将我的iPhone连接到Xcode并点击Product -->Analyze消息时...
子类'iPhoneSIX'中的viewWillAppear:实例方法UIViewController缺少一个[super viewWillAppear:]调用
我偶然偶然发现了这Product-->Analyze件事.[super viewWillAppear]即使所有设备上的所有设备都能正常运行,我是否真的需要添加.如果我不注意Product-->Analyze问题导航器,Apple会拒绝我的应用吗?
还有,......
[super viewWillAppear:YES];
Run Code Online (Sandbox Code Playgroud)
这叫做什么呢?
我正在开发一个 MAC 工具,您可以在其中查看UIElementsiOS 应用程序的当前视图控制器层次结构。我曾经用很多第三方应用程序来测试它。据我所知,大多数时候开发人员使用UITableView或来水平或垂直列出某些内容UICollectionView。
在测试一些标准应用程序(尤其是电子商务)时,正在使用UIScrollView作为UIView子视图并在其上添加手势。我想理解的是,为什么这些应用程序不使用表格视图或集合来列出某些内容?这背后的原因是什么?
我跟着从台阶上这个,因为我已经安装的CocoaPods问题,我手动下载了SDK的压缩,把它添加到项目中,它编译罚款,但我得到了很多的链接错误,因为以下的原因.谢谢你的帮助.
Undefined symbols for architecture x86_64:
"_CBCentralManagerOptionShowPowerAlertKey", referenced from:
l942 in GoogleMobileAds(flat-x86_64) "_CVBufferGetAttachment", referenced from:
l2397 in GoogleMobileAds(flat-x86_64) "_CVOpenGLESTextureCacheCreate", referenced from:
l2399 in GoogleMobileAds(flat-x86_64) "_CVOpenGLESTextureCacheCreateTextureFromImage", referenced from:
l2400 in GoogleMobileAds(flat-x86_64) "_CVOpenGLESTextureCacheFlush", referenced from:
l2398 in GoogleMobileAds(flat-x86_64) "_CVOpenGLESTextureGetName", referenced from:
l2400 in GoogleMobileAds(flat-x86_64) "_CVOpenGLESTextureGetTarget", referenced from:
l2400 in GoogleMobileAds(flat-x86_64) "_CVPixelBufferGetHeight", referenced from:
l2397 in GoogleMobileAds(flat-x86_64) "_CVPixelBufferGetWidth", referenced from:
l2397 in GoogleMobileAds(flat-x86_64) "_GLKMatrix4Identity", referenced from:
l2392 in GoogleMobileAds(flat-x86_64)
l2402 in GoogleMobileAds(flat-x86_64) "_OBJC_CLASS_$_CBCentralManager", referenced from:
objc-class-ref in GoogleMobileAds(flat-x86_64) "_OBJC_CLASS_$_CBUUID", referenced from: …Run Code Online (Sandbox Code Playgroud) 我们在此处遵循Firebase的动态说明,其中仅列出了一个需要"@import Firebase"的导入 - 但是当我们到达他们的行时
FIRDynamicLink *dynamicLink = [[FIRDynamicLinks dynamicLinks] dynamicLinkFromCustomSchemeURL:url];
if (dynamicLink) { ...
Run Code Online (Sandbox Code Playgroud)
... XCode为FIRDynamicLink提供未声明的标识符.与"导入FirebaseAnalytics"等其他模块不同,似乎没有其他专用于动态链接的库.
pod内容为:pod"Firebase/DynamicLinks"
要编译它的诀窍是什么?
我正在使用本教程制作示例应用程序.它使用填充了包含位置的JSon文件的表视图.在详细视图中,它使用Map并为表列表视图中选择的位置放置一个引脚.
我的问题是如何绘制当前用户位置之间的路线作为起点和"位置"位置作为目的地?
我现在在我的地图上有2个引脚:1)当前位置和2)目的地但我不知道如何将它们与路线相关联.使用这两个参数打开默认地图应用程序不是一个选项.
每个答案都要提前感谢.
这是一个常见的问题,但大多数答案似乎不起作用.我的应用程序中有一个计时器,我可以轻松启动并重新启动计时器.我试图暂停和恢复计时器,但现在恢复只从计时器继续计时器,该计时器大于我恢复它的计时器.这可能意味着它继续在后台计算.这是我的代码:
//Timer Variables
var startTime = NSTimeInterval()
var timer = NSTimer()
var isTiming = Bool()
var isPaused = Bool()
func updatedTimer() {
let currentTime = NSDate.timeIntervalSinceReferenceDate()
var elapsedTime: NSTimeInterval = currentTime - startTime
let minutes = UInt8(elapsedTime / 60.0)
elapsedTime -= (NSTimeInterval(minutes) * 60)
let seconds = UInt8(elapsedTime)
elapsedTime -= NSTimeInterval(seconds)
let strMinutes = String(format: "%02d", minutes)
let strSeconds = String(format: "%02d", seconds)
workoutTime.text = "\(strMinutes) : \(strSeconds)"
}
@IBAction func startButtonTapped(sender: AnyObject) {
if !timer.valid {
timer = NSTimer.scheduledTimerWithTimeInterval(0.01, …Run Code Online (Sandbox Code Playgroud) ios ×9
objective-c ×3
xcode ×2
admob ×1
analyzer ×1
app-id ×1
facebook ×1
firebase ×1
info.plist ×1
iphone ×1
mkmapview ×1
swift ×1
timer ×1
uiscrollview ×1
uitableview ×1