我试图实现一个在github上找到的项目。
https://github.com/hossamghareeb/Facebook-POP-Tutorial
在实施.h和.m文件时,出现一个错误,该错误是XCode找不到我的“ iostream”文件。
我在SWIFT中工作,使用桥接头来使用框架。当我尝试构建原始项目时,它可以工作,但是我的总是失败。

如何添加iostream文件?
提前致谢!
我正在尝试更改远程消息的声音
我已将文件添加到我的项目中,见图1

我还在AppDelegate中添加了所有内容.在didFinishLaunchingWithOptions中我添加了:
if (UIDevice.currentDevice().systemVersion as NSString).floatValue >= 8.0 {
UIApplication.sharedApplication().registerUserNotificationSettings(UIUserNotificationSettings(forTypes: .Sound | .Alert | .Badge, categories: nil))
UIApplication.sharedApplication().registerForRemoteNotifications()
} else {
UIApplication.sharedApplication().registerForRemoteNotificationTypes(.Badge | .Sound | .Alert)
}
//Clear badge
UIApplication.sharedApplication().applicationIconBadgeNumber = 0
UIApplication.sharedApplication().cancelAllLocalNotifications()
Run Code Online (Sandbox Code Playgroud)
我实施的其他方法是:
func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
let deviceTokenString = deviceToken.hexString
println(deviceTokenString)
let task = service.writeForNotifications(token: deviceTokenString, completionHandler: {
})
task.resume()
}
func application(application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: NSError) {
println("Failed to get token: \(error)")
}
Run Code Online (Sandbox Code Playgroud)
我从服务中收到的Json是:
{"aps":{"alert":"The push message!", "sound":"ice.caf"}}
Run Code Online (Sandbox Code Playgroud)
我不确定我是否已经忘记改变通知的声音了?当我收到通知时,它始终播放默认声音.
我正在开发一个应用程序作为appleTV的概念证明.而我正在尝试显示队列.哪个在不同的部门分开.我们有Mac,iPhone,iPad ......我想自动更新我的collectionView以显示哪个部门正在显示.
我已经成功自动更新了我的tableview.
有什么东西看不到吗?
这是我的控制器的代码
class QueueViewController : UIViewController, UICollectionViewDelegate, UICollectionViewDataSource, UITableViewDelegate, UITableViewDataSource {
var departments = [Department]()
var users = [User]()
let dateFormatter = NSDateFormatter()
@IBOutlet weak var collectionView: UICollectionView!
@IBOutlet weak var tableView: UITableView!
override func viewDidLoad() {
print("QueueViewController")
collectionView.delegate = self
collectionView.dataSource = self
self.view.backgroundColor = UIColor(patternImage: UIImage(named: "BackgroundQueue")!)
fetchDepartments()
dateFormatter.dateFormat = "HH:mm"
}
override func viewWillAppear(animated: Bool) {
//Hier moet de fetch task worden uitgevoerd
if departments.count > 0 {
startTimer()
}
}
override func viewWillDisappear(animated: …Run Code Online (Sandbox Code Playgroud)