我有一个包含多个对象的Firebase资源,我想使用Swift迭代它们.我期望的工作如下(根据Firebase文档)
https://www.firebase.com/docs/ios-api/Classes/FDataSnapshot.html#//api/name/children
var ref = Firebase(url:MY_FIREBASE_URL)
ref.observeSingleEventOfType(.Value, withBlock: { snapshot in
println(snapshot.childrenCount) // I got the expected number of items
for rest in snapshot.children { //ERROR: "NSEnumerator" does not have a member named "Generator"
println(rest.value)
}
})
Run Code Online (Sandbox Code Playgroud)
因此,似乎Swift迭代Firebase返回的NSEnumerator对象存在问题.
真的很受欢迎.
我刚刚将PhoneGap iOS应用更新到最新版本2.1.由于它使用Facebook登录,我还更新了此处显示的Facebook Connect插件.
Facebook登录在模拟器上顺利运行(使用iOS 5.1和6.0)但我在设备上出错(使用iOS 6)"操作无法完成com.facebook.sdk错误2"
我的应用程序的BundleID与Facebook应用程序的BundleID不匹配似乎是一个问题.我检查了我的info.plist文件中的BundleIdentifier和BundleURLName与我的Facebook应用程序设置中的Native iOS app下的Bundle ID匹配.
如果有人能帮我理解什么是错的...非常感谢.
我想试试Meteor,所以我说在coffeescript中开发一个小型的多房间聊天应用程序.我有问题使用把手将findOne的结果传递给html页面.
if Meteor.is_client
room=Rooms.findOne({id:1})
Template.room({room_name:room.name})
Run Code Online (Sandbox Code Playgroud)
在html页面中
<head>
<title>Chat!</title>
</head>
<body>
{{> room}}
</body>
<template name="room">
Welcome to {{room_name}}
</template>
Run Code Online (Sandbox Code Playgroud)
现在,假设id = 1的房间文档名称='Room1',我希望页面呈现'Welcome to Room1'但是有一个白页,控制台显示2个错误:
Uncaught TypeError: Cannot read property 'name' of undefined
Uncaught TypeError: Cannot read property 'room_name' of undefined
Run Code Online (Sandbox Code Playgroud)
即使该文件确实存在,显然房间也未定义.