首页 \ 问答 \ 如何连接和调试定制ClockKit Complications控制器?(How to connect and debug a custom ClockKit Complications controller?)

如何连接和调试定制ClockKit Complications控制器?(How to connect and debug a custom ClockKit Complications controller?)

我想要一个定制的ClockKit Complication工作。

  1. 我创建了一个符合CLKComplicationDataSource的自定义ComplicationController 。 它作为CLKComplicationPrincipalClass添加到Watch Extension的plist中。

我可以在手表上选择复杂功能并激活它,但我只看到“---------------”不是我的实际占位符。

我试过的

  • 我为我的ComplicationController添加了自定义override init(){…}并在其中放置了一个断点用于调试。 但即使运行Complication 构建方案,也不会达到这个中断点。 看起来像我的自定义ComplicationController从未实例化。

  • 我看到日志消息Extension received request to wake up for complication support. 但在代码中触发的位置并不清楚。

  • 我也尝试从我的主要InterfaceController调用以下内容来了解​​我的主动并发症

    if let server = CLKComplicationServer.sharedInstance() {
        for complication in server.activeComplications {
            server.reloadTimelineForComplication(complication)
        }
    }
    

    ...但server返回零。 没有任何并发​​症似乎是积极和重新加载。

  • 我如何成功连接我的自定义ComplicationController?

    也欢迎任何其他调试技巧。

    它通常足以从手表模拟器或iPhone上的手表应用程序中消除复杂情况,或者是否需要重新安装整个手表应用程序以查看有效的并发症相关更新? 另外,当我在自定义ComplicationController中记录一些内容时,我应该只在使用Complications构建方案运行时看到它的输出,还是应该使用正常的Watch App构建方案?

任何想法找到这个问题是受欢迎的。


I am trying get a custom ClockKit Complication working.

  1. I created a custom ComplicationController conforming to CLKComplicationDataSource. It’s added to the Watch Extension’s plist as CLKComplicationPrincipalClass.

I am able to select a complication on the watch and activate it but I only see "---------------" not my actual placeholder.

What I tried

  • I added custom override init(){…} to my ComplicationController and put a break point in it for debugging. But even when running the Complication build scheme this break point is never reached. It seems like my custom ComplicationController is never instantiated.

  • I do see a log message Extension received request to wake up for complication support. but it’s not clear to me where this is triggered in the code.

  • I also tried calling the following from my main InterfaceController to find out about my active complications

    if let server = CLKComplicationServer.sharedInstance() {
        for complication in server.activeComplications {
            server.reloadTimelineForComplication(complication)
        }
    }
    

    … but server returns nil. No complications appear to be active and reloaded.

Question

  • How do I successfully hook up my custom ComplicationController?

    Also any additional tips for debugging are welcome.

    Is it usually enough to remove the complications from the watch simulator or the watch app on the iPhone or do you need to re-install the whole watch app to see a complication related update in effect? Also, when I log something inside my custom ComplicationController, should I only see its output when running with the Complications build scheme or also with the normal Watch App build scheme?

Any ideas for finding the issue are welcome.


原文:https://stackoverflow.com/questions/34536561
更新时间:2022-01-11 19:01

最满意答案

我通常只是在使用之前memset整个事情。

memset( &info, 0, sizeof(info) );

I usually just memset the whole thing before using.

memset( &info, 0, sizeof(info) );

相关问答

更多
  • 像这样: ImmutablePoint *make_immutable_point(int x, int y) { ImmutablePoint init = { .x = x, .y = y }; ImmutablePoint *p = malloc(sizeof *p); if (p == NULL) abort(); memcpy(p, &init, sizeof *p); return p; } (请注意,与C ++不同,不需要在C中转换malloc的返回值,并且它通常被认 ...
  • 我想不出有这样一个原因:拥有引用或const成员的唯一特征是否意味着该类应具有这些特征中的任何一种(不可复制或不可复制) 我认为前提是错误的。 拥有const数据成员或引用数据成员不会使该类不可复制:它只是使得无法以破坏性方式 分配或移动它 。 这是因为对于const对象或引用,破坏性移动操作const :它将违背它们的语义,因为const对象的状态永远不会被改变,并且引用不能被解除。 但是, X不是可复制的或可移动分配的事实并不会影响构造这些对象的副本的可能性,正如你所指出的那样 - 这是一个合理的操作。 ...
  • 在VB.net中,Decimals和Bytes的默认值都是0,因此,当您运行Private Foo As FooStructure = New FooStructure ,系统会为Bar和Buzz指定值0 。 这应该足够,等于你的第二个例子。 In VB.net, the default values for Decimals and Bytes are both 0, therefore, when you run Private Foo As FooStructure = New FooStructur ...
  • 我一直无法在openssl库的头文件中找到它的结构类型。 目前还不清楚你指的是哪个版本的openssl,你看起来是怎样的,而是一个grep -r ' SSL;' /usr/include/openssl/ grep -r ' SSL;' /usr/include/openssl/很快在openssl / ossl_typ.h中找到了openssl 1.0.2的匹配: typedef struct ssl_st SSL; 以下为'ssl_st'的grep导致它在openssl / ssl.h中的定义: ...
  • 我通常只是在使用之前memset整个事情。 memset( &info, 0, sizeof(info) ); I usually just memset the whole thing before using. memset( &info, 0, sizeof(info) );
  • 你在init multiply STR_X2并multiply - 这会导致副本。 用指针取代它来修改你在main声明的static实例。 You're taking STR_X2 by value in init and multiply - this causes a copy. Take it by pointer instead to modify the static instance you declared in main.
  • 解决这个问题的唯一方法是,在定义数组后,手动初始化每个char指针为NULL,然后释放内存时,检查指针是否为NULL,以决定是否应该释放内存? 这绝对不是唯一的方式,但它是最常见和最标准的方式。 事实上,大多数程序员总是将指针初始化为零以防止seg错误。 初始化的最好方法是创建一个for循环或memset一切都为零(或使用calloc ,这是最简单的)。 Is the only way of getting around this problem, manually initializing each ch ...
  • 我想,你的困惑是因为你使用了两次相同的变量名称size , 作为结构成员变量 作为void init()的局部变量。 请注意,这两个是单独的变量。 struct stack的size成员变量是struct stack的成员。 您需要通过任一方式访问成员变量. 或->运算符[是的,即使结构是全局的]。 OTOH, void init()的int size是int类型的普通变量。 如果没有struct stack类型的变量,则不存在属于struct stack的size 。 同样,你也无法访问size ,它是s ...
  • 为了说明这一点,在C或C ++中没有任何反思。 因此,没有可靠的枚举成员变量的方法(默认情况下)。 如果你可以控制你的数据结构,你可以尝试一个std::vector或一个std::map然后将所有成员变量添加到vector /地图。 当然,这意味着你所有的变量都可能在堆上,所以这种方法会带来性能问题。 使用std :: map方法,这意味着你会有一种“穷人的”反思。 To state the obvious, there is no ...
  • 是的,这是合法的,并在很多地方使用。 如果您查看C ++参考文本,您会发现它涉及初始化排序,您可以放心自己这是真的。 Yes, that is legal and used in a lot of places. If you look in the C++ reference texts you'll find that it talks about initialization ordering where you can reassure yourself it's true.

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)