- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
<分区>
我目前正在制作一个应用程序,我正在使用带有 Xcode 8.2 beta 的 Swft 3。我正在努力做到这一点,以便用户能够从我的 iOS 项目中的 SWRevealViewController 访问社交媒体。当点击社交媒体按钮时,他们应该打开相应的应用程序。但是,当执行代码并打开 iOS 模拟器时,当我滑动打开 SWRevealViewController(菜单)时,应用程序崩溃了。
完整错误信息:
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<TheGunnOracleApp.SocialMedia 0x7ffd0d50c0d0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key dataSource.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010212dd4b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000101b8f21e objc_exception_throw + 48
2 CoreFoundation 0x000000010212dc99 -[NSException raise] + 9
3 Foundation 0x000000010169db3f -[NSObject(NSKeyValueCoding) setValue:forKey:] + 291
4 UIKit 0x0000000102e8e99f -[UIViewController setValue:forKey:] + 88
5 UIKit 0x0000000103102c6e -[UIRuntimeOutletConnection connect] + 109
6 CoreFoundation 0x00000001020d2b60 -[NSArray makeObjectsPerformSelector:] + 256
7 UIKit 0x00000001031015f2 -[UINib instantiateWithOwner:options:] + 1867
8 UIKit 0x0000000102e950d1 -[UIViewController _loadViewFromNibNamed:bundle:] + 386
9 UIKit 0x0000000102e959f3 -[UIViewController loadView] + 177
10 UIKit 0x000000010311561c -[UITableViewController loadView] + 84
11 UIKit 0x0000000102e95d28 -[UIViewController loadViewIfRequired] + 201
12 UIKit 0x0000000102e9657c -[UIViewController view] + 27
13 TheGunnOracleApp 0x00000001014d50fb -[SWRevealViewController _deployForViewController:inView:] + 235
14 TheGunnOracleApp 0x00000001014d4f58 -[SWRevealViewController _deploymentForViewController:inView:appear:disappear:] + 136
15 TheGunnOracleApp 0x00000001014d48c1 -[SWRevealViewController _rearViewDeploymentForNewFrontViewPosition:] + 433
16 TheGunnOracleApp 0x00000001014d32f2 -[SWRevealViewController _setFrontViewPosition:withDuration:] + 82
17 TheGunnOracleApp 0x00000001014d26c6 __65-[SWRevealViewController _dispatchSetFrontViewPosition:animated:]_block_invoke + 70
18 TheGunnOracleApp 0x00000001014d1300 -[SWRevealViewController _enqueueBlock:] + 160
19 TheGunnOracleApp 0x00000001014d261b -[SWRevealViewController _dispatchSetFrontViewPosition:animated:] + 251
20 TheGunnOracleApp 0x00000001014d0154 -[SWRevealViewController setFrontViewPosition:animated:] + 148
21 TheGunnOracleApp 0x00000001014cffed -[SWRevealViewController revealToggleAnimated:] + 93
22 TheGunnOracleApp 0x00000001014d05df -[SWRevealViewController revealToggle:] + 63
23 UIKit 0x0000000102cf645c -[UIApplication sendAction:to:from:forEvent:] + 83
24 UIKit 0x0000000103137971 -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 149
25 UIKit 0x0000000102cf645c -[UIApplication sendAction:to:from:forEvent:] + 83
26 UIKit 0x0000000102e7c344 -[UIControl sendAction:to:forEvent:] + 67
27 UIKit 0x0000000102e7c65d -[UIControl _sendActionsForEvents:withEvent:] + 444
28 UIKit 0x0000000102e7c7e7 -[UIControl _sendActionsForEvents:withEvent:] + 838
29 UIKit 0x0000000102e7b559 -[UIControl touchesEnded:withEvent:] + 668
30 UIKit 0x0000000102d63d5d -[UIWindow _sendTouchesForEvent:] + 2747
31 UIKit 0x0000000102d6544b -[UIWindow sendEvent:] + 4011
32 UIKit 0x0000000102d1254b -[UIApplication sendEvent:] + 371
33 UIKit 0x00000001034fda0f __dispatchPreprocessedEventFromEventQueue + 3248
34 UIKit 0x00000001034f6745 __handleEventQueue + 4879
35 CoreFoundation 0x00000001020d28e1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
36 CoreFoundation 0x00000001020b7b0c __CFRunLoopDoSources0 + 556
37 CoreFoundation 0x00000001020b6ff6 __CFRunLoopRun + 918
38 CoreFoundation 0x00000001020b6a04 CFRunLoopRunSpecific + 420
39 GraphicsServices 0x0000000107e37a6f GSEventRunModal + 161
40 UIKit 0x0000000102cf4808 UIApplicationMain + 159
41 TheGunnOracleApp 0x00000001014f2d0f main + 111
42 libdyld.dylib 0x0000000105ddd68d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
这是社交媒体中每个按钮的代码。
注意:由于 Facebook 一开始无法正常工作,我删除了其余社交媒体的代码:
import Foundation
import UIKit
class SocialMedia: UITableViewController{
@IBAction func facebookOpen(_ sender: Any) {
UIApplication.shared.open(NSURL(string: "https://www.facebook.com/gunnoracle")! as URL)
}
}
这是我的 Main.storyboard UITableViewController 的截图:
似乎最近我看到越来越多的人开始在他们的样式表中使用 media="all" 而不是 media="screen"。 我的问题是什么时候应该使用 media="all" 而不是 media="scree
我正在尝试使用 https://www.instagram.com/developer/endpoints/media/ ,但对于我使用的每个媒体 ID,我总是得到相同的结果: { "meta
哟,我正在为服务器制作一个 MOTD 供最终用户阅读。但是,对于使用较小显示器的用户来说,它看起来非常压缩,例如,当分辨率为 1280x1040 时,它会被拉低。我不熟悉 CSS 中的 @media
我在我的 CSS 文件中使用了 @media screen 而不是 (-webkit-min-device-pixel-ratio:0)。我的问题是关于指定的值,即在这种情况下为“0”。值的变化将如何
我正在播放 Activity 中的视频,我需要显示/隐藏顶部栏 View 以及媒体 Controller 。所以当媒体 Controller 在屏幕上时,我的顶部 View 应该是可见的,当媒体 Co
我在我的 WordPress 主题中创建了一个小部件来显示图像。到目前为止,小部件可以工作,我可以输入值并在前端显示这些值。 当我选择一个小部件并将其放入小部件区域时,媒体上传按钮不起作用。在 Wor
我正在使用MWFeedParser从此处读取Youtube原子供稿:here xml代码: 我如何获取媒体的网址:缩略图? 我试图更改MWFeedParser.m 由此: else if ([cu
当使用 Python 向 Instagram API 发出 GET 请求时,传递所需的变量,如下所示 photos = api.media_search(lat=latitude, lng=longi
我正在使用与媒体播放器关联的媒体 Controller 来播放声音。问题是媒体 Controller 一旦失去焦点就会隐藏起来。我有一个按钮,按下时会播放声音,媒体 Controller 会出现在屏幕
我有一个媒体播放器并与它关联了一个媒体 Controller 。控件工作正常。 我遇到了两个问题: 当媒体 Controller 获得焦点时,即用户触摸它然后触摸屏幕的另一部分时,媒体 Control
关闭。这个问题需要debugging details .它目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and th
我在对话框中显示一个 VideoView 并向其附加一个媒体控件。 但是当我尝试点击媒体控件(播放、搜索栏等)时,对话框会消失。 媒体控制按钮不会被点击,而是将点击注册为 Dialog 的 Outsi
我目前正在使用 HTML 编写可打印文档,它将显示从数据库中提取的数据。我的想法是我将使用 HTML/CSS 使文档看起来不错,但它将专门用于打印。 文档的布局使用表格来控制数据库中数据的显示方式。
我需要在网络应用程序中打印我的报告。 我有在我的代码中。但它不应用任何样式。另一方面,如果我使用 在文档中编写 print.css 代码一切正常。 怎么了? 最佳答案 也许你在主样式之前插入打印样式
CSS html{ overflow-y:scroll; } js function showW(){ var a=($(window).width()); $('#
我编写了一个 Chrome 扩展程序,其中一个功能是您可以在您所在的页面中调出一个帮助面板,其中包含其使用指南。这个帮助面板是通过JS插入到页面中的,它的CSS都是通过$('#selector_for
我需要为 WORM 媒体开发归档软件。 这种类型的媒体允许通常的访问操作:读取、写入,但文件一旦写入,就无法修改或删除。 因为这样的媒体可能很昂贵,我想知道如何在开发阶段为测试创建一个假的 WORM
下面的这个 Activity 工作正常,但 mediaController 仅在我单击屏幕时显示。第二个问题是媒体 Controller 只显示 3 秒。我应该怎么做才能消除这个问题? public
我正在使用 VideoView 播放本地 mp4,我也在使用 MediaController。媒体控制栏未显示在我的视频剪辑下方,而是显示在屏幕中间。我使用 setAnchorView 将其附加到我的
我的布局包含 videoView 还有java代码中的Medicontrolleri: final MediaController mediaCont
我是一名优秀的程序员,十分优秀!