gpt4 book ai didi

ios - 'WKinterfaceGroup' 没有可见的@interface 声明选择器 : has something changed in iOS 8. 3?

转载 作者:行者123 更新时间:2023-11-28 19:50:08 25 4
gpt4 key购买 nike

我正在使用 iOS SDK 8.3 并尝试遵循 this tutorial在 watch 套件应用中创建表格。

我在 iWatch 应用程序的界面 Controller 上添加了一个表,然后将其链接到我的界面 Controller 。我创建了一个自定义行类并将该行链接到行 Controller 类。然后我在行中添加了几个项目并将它们链接到行 Controller 类中的 socket 。但是我得到了一些错误:

enter image description here

这是我的接口(interface) Controller 类:

#import <WatchKit/WatchKit.h>
#import <Foundation/Foundation.h>

@interface InterfaceController : WKInterfaceController

@property (strong, nonatomic) NSArray *devicesArray;

@property (weak, nonatomic) IBOutlet WKInterfaceGroup *devicesTable;

@end

这是触发错误的代码:

- (void)awakeWithContext:(id)context {
[super awakeWithContext:context];
NSLog(@"%@ initWithContext", self);
self.devicesArray = @[@"type A", @"type B"];
[self.devicesTable setNumberOfRows:self.devicesArray.count withRowType:@"MyTableRowController"];

[self.devicesTable enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {

MyTableRowController* row = [self.devicesTable rowControllerAtIndex:idx];

[row.deviceType setText: (NSString*)obj];
[row.logo setImage:[UIImage imageNamed:(NSString *)obj]];

}];

enter image description here

最佳答案

您的 devicesTable 声明为 WKInterfaceGroup它确实支持您正在调用的方法。我确定您打算使用 WKInterfaceTable .您可能无意中从组中拖出了表的连接,而不是 Interface Builder 中的表。

关于ios - 'WKinterfaceGroup' 没有可见的@interface 声明选择器 : has something changed in iOS 8. 3?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29651348/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com