小编asj*_*sjj的帖子

iOS 7.1 UitableviewCell内容与下面的内容重叠

所以我有代码,它在iOS 7.0上成功运行,但在7.1中没有.我有一个简单的tableview,代码如下:

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 10;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 70.0;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];

    for (UIView *view in cell.contentView.subviews) {
        [view removeFromSuperview];
    }

    UILabel *label = [[UILabel alloc] init];
    label.text = [NSString string];

    for (NSInteger i = 0; i < 20; i++) {
        label.text = [label.text stringByAppendingString:@"label String "];
    }

    label.translatesAutoresizingMaskIntoConstraints = NO;
    label.numberOfLines = 0; …
Run Code Online (Sandbox Code Playgroud)

uitableview uilabel ios autolayout ios7.1

30
推荐指数
2
解决办法
3万
查看次数

对于包含UIDatePicker的单元格,dequeueReusableCellWithIdentifier需要0.5秒

我有一个动态的tableview,其中选择了一个单元格并显示另一个包含UIDatePicker在其下方的单元格- 就像在日历应用程序中一样.

这非常有效,但是当用户首次滚动它时(当它的高度为0时),我遇到了单元的初始加载问题.

调查为什么它很慢我dequeueReusableCellWithIdentifier在NSLogs中包含调用来查看时间.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSString *CellIdentifier = [[cellIdentifiers objectAtIndex:indexPath.section] objectAtIndex:indexPath.row];
    NSLog(@"Creating cell:%@", CellIdentifier);
    UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
    NSLog(@"Finished cell:%@", CellIdentifier);
    return cell;
}
Run Code Online (Sandbox Code Playgroud)

NSLog显示了这个:

14:47:42.427 Creating cell:Date
14:47:42.437 Finished cell:Date
14:47:42.470 Creating cell:DatePicker
14:47:43.006 Finished cell:DatePicker
14:47:43.046 Creating cell:Time
14:47:43.055 Finished cell:Time
14:47:44.753 Creating cell:DatePicker
14:47:45.253 Finished cell:DatePicker
Run Code Online (Sandbox Code Playgroud)

日期/时间是包含2个UILabel的单元格,DatePicker是包含UIDatePicker的单元格.

UIDatePicker单元格需要大约半秒钟才能完成.在第一次滚动之后,它加载得更快,因此没有明显的延迟 - 除了第一次点击日期单元格,因此它下面的DatePicker单元格将其高度从0更改为220.

NSLog首次打开单元格:

14:59:34.334 Creating cell:DatePicker
14:59:34.877 Finished cell:DatePicker
Run Code Online (Sandbox Code Playgroud)

我注意到日历应用程序在第一次打开UIDatePicker单元格时有一点延迟,但这似乎并不像我的应用程序那样长.

我正在测试iPhone 4,这可能是一个促成因素.

有没有人对我可能做错了什么或能做些什么来加快速度?

uidatepicker uitableview ios

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

如何从其他Mac向AppStore提交应用程序?

我在Mac Mini 1上编写了一个应用程序,并使用已安装的代码签名和配置文件提交给appstore.

我现在有一个新的Mac Mini 2,具有更好的速度和内存.所以我把我的应用程序移到了它.

如何使用新的Mac Mini 2提交相同的应用程序?因为我的配置文件和代码签名密钥安装在Mac Mini 1上.我该怎么办?

app-store ios

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