小编Fai*_*yed的帖子

Xcode"设备锁定"当iPhone解锁时

当我尝试构建和运行时,Xcode表示我的设备已被锁定.我看了看我的iPhone,它根本没有锁定......可能的错误?我该如何解决?

iphone xcode device ios

297
推荐指数
19
解决办法
18万
查看次数

在WatchKit错误中填充TableView

这就是我目前在WatchKit中填充表视图的方式:

    - (void)awakeWithContext:(id)context {
    [super awakeWithContext:context];

    // Configure interface objects here.

    menuItems = [[NSMutableArray alloc] initWithObjects:@"Pizza", @"Chicken", @"Bread", nil];

    for (NSString *item in menuItems)
    {
        MenuRowController *menuRow = [myTableView rowControllerAtIndex:[menuItems indexOfObject:item]];
        [menuRow.menuItemLabel setText:item];
    }
}
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

Extension[980:19597] Error - attempt to ask for row 0. Valid range is 0..0
Printing description of item:
Pizza
2015-07-05 01:58:07.284 ScanBarWatch WatchKit Extension[980:19597]    Error - attempt to ask for row 1. Valid range is 0..0
2015-07-05 01:58:14.780 ScanBarWatch WatchKit Extension[980:19597] Error - attempt to …
Run Code Online (Sandbox Code Playgroud)

objective-c ios watchkit

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

如何在WatchKit中使用"context"传递多个对象

我正在使用以下代码将数据传递给我的第三个控制器:

[self presentControllerWithName:@"ThirdView" context:MyArray];
Run Code Online (Sandbox Code Playgroud)

问题是,我想传递的不仅仅是一个简单的数组.我想传递一个单独的字符串,如果可能的话,另一个数组,我不想将字符串或其他数组添加到"MyArray".

有没有不同的方法来解决这个问题,或者我只是重构这个代码?

objective-c ios watchkit

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

标签 统计

ios ×3

objective-c ×2

watchkit ×2

device ×1

iphone ×1

xcode ×1