小编The*_*onz的帖子

如何将图像和标签添加到UINavigationBar作为标题?

目前我只知道如何将字符串作为标题:

[self setTitle:@"iOS CONTROL"];
Run Code Online (Sandbox Code Playgroud)

或带图像

self.navigationItem.titleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon.png"]];
Run Code Online (Sandbox Code Playgroud)

但不是两个在同一时间

有解决方案吗?谢谢

uinavigationbar uiimage ios

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

如何使用NSLog显示对象数组

使用"NSLog"显示对象数组的解决方案是什么.

我可以用我的TableView显示它:

- (UITableViewCell *)tableView:(UITableView *)tableView
             cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        UITableViewCell *cell = [tableView
                                 dequeueReusableCellWithIdentifier:@"MyBasicCell2"];
        DataOrder *bug = [[[ArrayBuying instance] tableau] objectAtIndex:indexPath.row];
      static NSString *CellIdentifier = @"MyBasicCell2";
        CustomCellFinalView *Cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];


        if (!Cell) {
            Cell = [[CustomCellFinalView alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
        }

        Cell.NomProduit.text = bug.product;
        Cell.Quantite.text = [NSString stringWithFormat:@"%.2f €", bug.price];
        Cell.Prix.text = [NSString stringWithFormat:@"X %d  ", bug.quantite];

        return Cell;
        return cell;    
}
Run Code Online (Sandbox Code Playgroud)

当我尝试我的ViewDidLoad:方法时

NSLog(@"%@",[[ArrayBuying instance] tableau]);
Run Code Online (Sandbox Code Playgroud)

我在目标输出中获得:

(
    "<DataOrder: 0x15d5d980>",
    "<DataOrder: 0x15de1aa0>"
)
Run Code Online (Sandbox Code Playgroud)

非常感谢您的未来帮助

arrays object objective-c ios

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

对象数组和 - (NSString*)描述

我该如何实施- (NSString *)description

我做:

- (NSString *)description{
    NSString *descriptionString =  [NSString stringWithFormat:@"%@",[self tableau]];
    return descriptionString;
}
Run Code Online (Sandbox Code Playgroud)

并添加到我的ViewController中

NSLog(@"%@",[[[ArrayBuying instance] tableau] description]);
Run Code Online (Sandbox Code Playgroud)

我刚刚获得:

2013-12-03 10:47:50.323 ApplicationTest2[561:60b] (
    "<DataOrder: 0x156eb090>",
    "<DataOrder: 0x16926340>"
)
Run Code Online (Sandbox Code Playgroud)

非常感谢你

arrays object objective-c ios

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

标签 统计

ios ×3

arrays ×2

object ×2

objective-c ×2

uiimage ×1

uinavigationbar ×1