小编Ali*_*tra的帖子

从自定义键盘应用程序扩展发出 HTTP 请求

我的自定义键盘应用程序扩展在我的真实设备上表现不同,但在我的 iOS 模拟器上表现良好。

我在真实设备上收到以下错误

2017-02-17 16:30:01.369868 Custom Keyboard[8472:570942] [default] error registring notify port: (1000000)
2017-02-17 16:30:01.371652 Custom Keyboard[8472:570889] [Common] BKSAccelerometer unable to create notifyd token for device orientation
2017-02-17 16:30:01.702241 Custom Keyboard[8472:570940] [] __nwlog_err_simulate_crash_libsystem libsystem simulate crash failed "libsystem_network.dylib: networkd_settings_setup_notify_watch :: notify_register_dispatch(com.apple.system.networkd.settings) [status 1000000] failed"
2017-02-17 16:30:01.706023 Custom Keyboard[8472:570940] [] networkd_settings_setup_notify_watch notify_register_dispatch(com.apple.system.networkd.settings) [status 1000000] failed, dumping backtrace:
Run Code Online (Sandbox Code Playgroud)

我正在使用标准 Alamofire 代码:

Alamofire.request("https://httpbin.org/get").response { response in
    print("Request: \(response.request)")
    print("Response: \(response.response)")
    print("Error: \(response.error)")

    if let data = response.data, let utf8Text = String(data: data, …
Run Code Online (Sandbox Code Playgroud)

ios swift ios-app-extension swift3

5
推荐指数
2
解决办法
2023
查看次数

将'const'作为'this'参数传递错误

我很久以来就遇到了错误,接下来,我正在学习,我想我不明白这个错误.

 droid.cpp: In function ‘std::ostream& operator<<(std::ostream&, const Droid&)’: 

droid.cpp:94:30: error: passing ‘const Droid’ as ‘this’ argument of ‘std::string 

Droid::getId()’ discards qualifiers
 [-fpermissive]
Run Code Online (Sandbox Code Playgroud)

第94行:

std::ostream&   operator<<(std::ostream &os, Droid const & a)
    os << "Droid '" << a.getId() << "', " << *a.getStatus() << ", " << a.getEnergy() << std::endl;
Run Code Online (Sandbox Code Playgroud)

和听众:

std::string   getId();
Run Code Online (Sandbox Code Playgroud)

我对"operator <<",a.getId,a.getStatus,a.getEnergy中的3个调用有相同的错误.

有人可以向我解释一下编译器在说什么吗?

c++ g++ compiler-flags

3
推荐指数
1
解决办法
8705
查看次数

标签 统计

c++ ×1

compiler-flags ×1

g++ ×1

ios ×1

ios-app-extension ×1

swift ×1

swift3 ×1