首页
\
问答
\
Firebase setValue()在模拟器中工作,但不在设备上,任何人都知道为什么?(Firebase setValue() works in simulator but not on device, anyone know why? iOS 10, Swift 3.1)
Firebase setValue()在模拟器中工作,但不在设备上,任何人都知道为什么?(Firebase setValue() works in simulator but not on device, anyone know why? iOS 10, Swift 3.1)
此代码按照模拟器中的要求保存到Firebase数据库,但完成处理程序不会在设备上调用。 有谁知道为什么或可能的修复?
var customersRef : FIRDatabaseReference { return dbRef.child("customers") } func saveDealData(dealBuilder: DealBuilder, errMsgHandler: ErrMsgHandler?) { print("Shown in log in sim and device") customersRef.child(u.id!).child("deals").childByAutoId().setValue("true") { error, dbRef in print("Is called for sim but not device") } }
我试图摆脱尾随的关闭,并将setValue()放在里面,但是同样的情况发生了:
customersRef.child(u.id!).child("deals").childByAutoId().setValue("true", withCompletionBlock: { error, dbRef in print("Is called in sim but not device") })
This code saves to the Firebase database as required in the simulator but the completion handler doesn't get called on the device. Does anyone know why or of a possible fix?
var customersRef : FIRDatabaseReference { return dbRef.child("customers") } func saveDealData(dealBuilder: DealBuilder, errMsgHandler: ErrMsgHandler?) { print("Shown in log in sim and device") customersRef.child(u.id!).child("deals").childByAutoId().setValue("true") { error, dbRef in print("Is called for sim but not device") } }
I've tried getting rid of trailing closure and putting inside setValue() as below, but the same happens:
customersRef.child(u.id!).child("deals").childByAutoId().setValue("true", withCompletionBlock: { error, dbRef in print("Is called in sim but not device") })
原文:https://stackoverflow.com/questions/43428588
更新时间:2023-05-02 07:05
最满意答案
Just use the view
django.views.defaults.page_not_found
.
相关问答
更多-
我得到了答案.. 无论我们在html文件中写入的'动作'是写入.xml文件下的url-pattern。 例如: 我的html代码: ...
-
花了我一会儿才弄清楚, 最终我不得不raise Http404而不是return它! Took me a while to figure out, Eventually I had to raise the Http404 and not return it!
-
根据你的网址,即使他们有不同的视图,如果我给它加值,结果将是: urlpatterns = patterns('', # http://localhost:8000/English/ url(r'(?P
.*)/$', views.by_lang_slug, name='by_lang'), # http://localhost:8000/YourBook/ url(r'(?P .*)/$', views.by_book_slug, n ... -
查看Http404 Exception 文档 : 为方便起见,并且因为在您的站点上有一个一致的404错误页面是个好主意,Django提供了一个Http404异常。 如果您在视图函数中的任何位置引发Http404,Django将捕获它并返回应用程序的标准错误页面以及HTTP错误代码404。 以下是文档中的示例用法: from django.http import Http404 from django.shortcuts import render_to_response from polls.models ...
-
在url模式下提升Http404(Raise Http404 in url pattern)[2023-08-08]
只需使用视图django.views.defaults.page_not_found 。 Just use the view django.views.defaults.page_not_found. -
3.1中引入了pattern属性,它引入了多个过滤器链的名称空间支持。 Spring Security 2已经过时了(你不应该使用它)。 intercept-url元素中的模式是独立的,因为它们与传入请求URI的匹配方式与筛选器链模式http检查相同。 但是,如果后者不匹配,则过滤器链将不会被应用于请求,因此为了产生任何效果,它们必须与过滤器链式样一致。 对于您发布的示例,这意味着没有任何/photos模式会有任何影响。 它们应该都有主过滤器链匹配的前缀 - 即它们应该以/users/photos开始。 T ...
-
你错过了服务的名称。 在你的情况下将是这样的: http://engineappservicev001.azurewebsites.net/something.svc/dowork 更多信息在这里: http://www.codeproject.com/Articles/571813/A-Beginners-Tutorial-on-Creating-WCF-REST-Services you're missing the name of the service. In your case would be ...
-
我认为从模板中提取404是不可能的,如果可以的话,你不应该这样做。 您应该将逻辑和表示分开。 你有两种声音可能性。 不要使用模板标记渲染任何内容(静默失败) 提出模板错误。 你没有确切地说出你的模板标签正在做什么,所以我不能推荐这两个中的任何一个,但最常见的是模板标签,是静默失败。 I don't think it's possible to raise a 404 from the template, and you shouldn't do it if you could. You should kee ...
-
默认情况下,请求没有error_404_message属性,因此request.error_404_message会给您一个错误。 您链接的答案将其设置为属性,但我不明白您为什么要在Django 1.9+中执行此操作,因为您已经可以访问视图中的异常。 自定义视图的签名应为: def myError(request, exception, template_name='404.html'): ... 您现在可以访问exception 。 您可以查看默认页面未找到的视图 ,了解它如何从异常中提取消息。 ...
-
Microsoft EDGE使用typescript文件报告XHR HTTP404(Microsoft EDGE reports XHR HTTP404 with typescript file)[2024-03-26]
它可能是sourceMaps。 关闭tsconfig.json文件中的该选项。 It's probably sourceMaps. Turn off that option in your tsconfig.json file.