标签: wkinterfaceobject

WKInterface按钮不会更改标题

我在通知回来之后尝试更改按钮的标题,但它根本没有响应.我检查了它不是零并检查我分配的文本,一切都很好.我做了属性类型strong而不是weak成功.

- (void) setButtonTitleFromSelectedSearchResult:(NSNotification *)notif
{

    [self popController];

    self.sourceMapItem = [[notif userInfo] valueForKey:@"SelectedResult"];

    NSLog(@"The Selected Result is: %@", self.sourceMapItem.name);

    //Testing
    NSLog(@"%@", self.fromButton); // check it's not nil

    [self.fromButton setTitle:self.sourceMapItem.name];
}
Run Code Online (Sandbox Code Playgroud)

title ios watchkit wkinterfaceobject

8
推荐指数
1
解决办法
755
查看次数

WKInterfaceButton IBAction发送nil发送者

2015-05-02 23:56:34.047 TapIt WatchKit Extension[1398:18615] b: <WKInterfaceButton: 0x6080000580c0>
2015-05-02 23:56:34.048 TapIt WatchKit Extension[1398:18615] sender: (null)

- (IBAction)tapped:(id)sender {
    bool success = false;
    NSLog(@"b: %@", b);
    NSLog(@"sender: %@", sender);
Run Code Online (Sandbox Code Playgroud)

为什么这会通过零?

ios watchkit wkinterfaceobject

1
推荐指数
1
解决办法
463
查看次数

标签 统计

ios ×2

watchkit ×2

wkinterfaceobject ×2

title ×1