我将Xcode更新到最后一个版本,现在当我正在尝试编译项目时,我收到错误"无效的bitcode签名",hovewer,我的项目的bitcode被禁用.我该如何解决?我应该更改什么来正确签署我的bitcode?
我的Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target 'MyProjectName' do
pod 'Realm'
pod 'CorePlot'
pod 'GoogleMaps'
end
Run Code Online (Sandbox Code Playgroud)
我已经检查过,一切都很好.
作为AudioSessionInitialize
和AudioSessionGetProperty
被弃用,我得到错误的返回值:
CFStringRef state = nil;
UInt32 propertySize = sizeof(CFStringRef);
AudioSessionInitialize(NULL, NULL, NULL, NULL);
OSStatus status = AudioSessionGetProperty(kAudioSessionProperty_AudioRoute, &propertySize, &state);
[[AVAudioSession sharedInstance] setActive:YES error:nil];
if (status == kAudioSessionNoError) {
return CFStringGetLength(state) == 0; // YES = silent
}
return NO;
Run Code Online (Sandbox Code Playgroud)
从这段代码(我在这里找到),无论实际设备处于何种状态,我都会得到相同的错误结果.如何检测设备上的静音模式是否为ON?
在我的应用程序中,当用户终止应用程序时,我需要向服务器发送一些指令。在applicationWillTerminate函数中,我尝试发送它,但是它从未发送到服务器。我尝试使用Alamofire和本机URLSession,但是它不起作用。有人知道我怎么发送吗?我用这个代码
let request = "\(requestPrefix)setDriverOrderStatus"
if let url = URL(string:request) {
var parameters : [String : String] = [:]
parameters["access_token"] = UserSession.accessToken
parameters["driver_id"] = UserSession.userID
parameters["status"] = status
var req = URLRequest(url: url)
req.httpMethod = HTTPMethod.put.rawValue
do {
req.httpBody = try JSONSerialization.data(withJSONObject: parameters, options: .prettyPrinted)
} catch let error {
print(error.localizedDescription)
}
_ = URLSession.shared.dataTask(with: req, completionHandler: { data, response, error in
guard error == nil else {
print(error ?? "error")
return
}
guard let data = data else { …
Run Code Online (Sandbox Code Playgroud)