我正在播放声音AVAudioPlayer
.
iPod中的音量(iOS7和iOS8都很好).
但是当我在iPhone中播放相同的声音时,声音播放的音量非常低.
这是我的代码:
var audioPlayer: AVAudioPlayer?
var soundURL:NSURL? = NSURL(fileURLWithPath: NSBundle.mainBundle().pathForResource("sound", ofType: "mp3")!)
audioPlayer = AVAudioPlayer(contentsOfURL: soundURL, error: nil)
audioPlayer?.prepareToPlay()
audioPlayer?.volume = 1
audioPlayer?.play()
Run Code Online (Sandbox Code Playgroud)
我已经在我的项目中包含了AudioToolbox.framework库.
如何改善iPhone6和6+的声音?
编辑
最近我注意到声音自动增加了几秒钟,但不知道发生了什么错误.
我想在ViewController中获取JavaScript返回值,
问题是,如果像String这样的数据很少,我就会得到它.
但是如果有像JSON对象那样的大数据,它显示为零.
当我在Safari> Develop> iOS模拟器中调用相同的JS函数时,它会在1-2秒后给出JSON对象.
这是我的代码:
var value = IBwebView.stringByEvaluatingJavaScriptFromString("get_small_string()")
println(value) //Printing value
Run Code Online (Sandbox Code Playgroud)
但这打印为零,
var value = IBwebView.stringByEvaluatingJavaScriptFromString("get_JSON()")
println(value) //Printing nil
Run Code Online (Sandbox Code Playgroud)
谁知道如何在iOS对象中获取大尺寸JS返回值?
目前我这样做,
将选择器调用为:
NSTimer.scheduledTimerWithTimeInterval(0.5, target: self, selector: "startAnimation:", userInfo: loadingView, repeats: true)
Run Code Online (Sandbox Code Playgroud)
选择器方法如下:
private class func startAnimation(timer:NSTimer){
var loadingCircularView = timer.userInfo as UIView
}
Run Code Online (Sandbox Code Playgroud)
我收到警告,应用程序崩溃:
warning: object 0x67c98 of class ‘ClassName’ does not implement methodSignatureForSelector: -- trouble ahead Unrecognized selector +[ClassName startAnimation:]
Run Code Online (Sandbox Code Playgroud) 我看过很多亚马逊文档,但没有找到足够的信息来使用Swift上传和下载图像到S3.
我怎样才能做到这一点?
我有.framework
先前正在工作的文件,其中包含其他.a/.framework
文件.
我的框架构建成功,但在将我的.framework
文件添加到另一个项目后,它无法正常工作.
添加其他后.a
和.framework
文件在我的框架搭建阶段,我得到这个错误.
0 0x103014342 __assert_rtn + 144
1 0x10307d28e ld::tool::OutputFile::addressOf(ld::Internal const&, ld::Fixup const*, ld::Atom const**) + 262
2 0x10307ef54 ld::tool::OutputFile::applyFixUps(ld::Internal&, unsigned long long, ld::Atom const*, unsigned char*) + 3712
3 0x103083693 ld::tool::OutputFile::writeAtoms(ld::Internal&, unsigned char*) + 489
4 0x10307c59e ld::tool::OutputFile::writeOutputFile(ld::Internal&) + 818
5 0x10307669c ld::tool::OutputFile::write(ld::Internal&) + 178
6 0x1030151c0 main + 1164
7 0x7fff8d04c5ad start + 1
A linker snapshot was created at:
/tmp/SDKsIntegrated_Test-2016-03-01-190200.ld-snapshot
ld: Assertion failed: (_mode == modeFinalAddress), …
Run Code Online (Sandbox Code Playgroud) 我试图消除所有的活动类型开始com.apple.UIKit.activity.Open.Copy
从UIActivityViewController
。
我尝试跟随但未成功,有人这样做吗?
func showShareActivity(videoURL : NSURL, onComplete:@escaping (Bool, UIActivityType?, Error?)->()) {
let activityVC = UIActivityViewController(activityItems: [videoURL], applicationActivities: nil)
activityVC.excludedActivityTypes = [UIActivityType(rawValue: "com.apple.UIKit.activity.Open.Copy.*")]
activityVC.completionWithItemsHandler = { (activity, success, items, error) in
onComplete(success, activity, erro
}
appDelegate?.window.rootViewController?.present(activityVC, animated: true, completion: nil)
}
Run Code Online (Sandbox Code Playgroud)
注意:当我尝试一一排除时,它可以工作,但是我想一起删除(有些我可能不知道)。(Swift / ObjC任何解决方案都可以。)
com.apple.UIKit.activity.Open.Copy.com.apple.iMovie
com.apple.UIKit.activity.Open.Copy.com.apple.itunesu
com.apple.UIKit.activity.Open.Copy.net.whatsapp.WhatsApp
基本上这些都是以Import with
或开头的Copy to
,请参考下图。
我认为Evernote应用程序也是如此。
错误,
此应用程序或其中包含的应用程序具有Siri Intents应用程序扩展,该扩展程序在其IntentsRestrictedWhileLocked键的数组值中声明了不在其IntentsSupported键的数组值(在其Info.plist的NSExtension词典的NSExtensionAttributes字典中)中的值。
我在中添加了一项IntentsRestrictedWhileLocked
。