简体   繁体   English

从Parse.com iOS 8 Today小部件获取字符串

[英]Get string from Parse.com iOS 8 Today Widget

I would like to retrieve a string from Parse.com in my notification centre widget. 我想在通知中心小部件中从Parse.com检索一个字符串。 I have this code Parse.setApplicationId("appId", clientKey: "clientKey") in the widget's viewDidLoad but there is an error. 我在小部件的viewDidLoad有这段代码Parse.setApplicationId("appId", clientKey: "clientKey") ,但是有错误。 The error says: 错误提示:

Use of unresolved identifier 'Parse'

Where am I going wrong? 我要去哪里错了?

Make sure that you have added Parse and all needed frameworks to the widget target. 确保已将Parse和所有需要的框架添加到小部件目标。 You may have added them to your apps target when you dragged them in but they need to be added to the widgets target as well if you plan on using them in there, 当您将它们拖入时,您可能已经将它们添加到了应用程序目标中,但是如果您打算在其中使用它们,则也需要将它们添加到小部件目标中,

Yes, you need a bridging header for the extension as well as the app. 是的,您需要扩展程序以及应用程序的桥接头。 Also you need to call Parse.setApplicationId() when your extension is loaded just as you do when your app is launched. 同样,您需要在加载扩展程序时调用Parse.setApplicationId(),就像启动应用程序时一样。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM