English 中文(简体)
在目标C的子里读图像
原标题:Read image in a subfolder with objective C

我试图在我的桌子上增加一个形象:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }
    NSString *ligneTableau = [NSString stringWithFormat:@"%@", [[tableau objectAtIndex:indexPath.row] label]];
    cell.textLabel.text=ligneTableau;   // Configure the cell.

    cell.imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"images/sections/%@.png", [[tableau objectAtIndex:indexPath.row] key]]];
    return cell;
}

i NS Carlo(a) 显示图像,即获得优素(“images/sections/name.png”)。 我的所有图像都列在我的项目的“影子”中,作为“images/sections/name.png”。

但是,我的图像没有出现在我的行文上,但如果用我项目根基的图像文档名称取代图像/科/%@.png的话,它就发挥了作用。

为什么不能读一下我的分层形象?

感谢你(我是开端人)

最佳回答

这涉及X条码如何发挥作用以及如何发挥作用。 你们的形象出现在你的X条码项目中,其途径与形象在生成的旁观上一样。 因此,检查你们的app,从那里走路。 如果你在你身上添加一个形象的话,否则你就不在场。 Xcode Project, it will be copied to the fundamental of their .app bundle. 如果你想要一整倍的双倍像在你身上。 您在Xcode项目上必须增加一个倍数(而不是一个组)。

问题回答

暂无回答




相关问题
Asynchronous request to the server from background thread

I ve got the problem when I tried to do asynchronous requests to server from background thread. I ve never got results of those requests. Simple example which shows the problem: @protocol ...

objective-c: Calling a void function from another controller

i have a void, like -(void) doSomething in a specific controller. i can call it in this controller via [self doSomething], but i don t know how to call this void from another .m file. I want to call ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

NSUndoManager and runModalForWindow:

I have a simple Core Data app which displays a list of entities in the main window. To create or add new entities, I use a second modal window with a separate managed object context so changes can be ...

NSMutableArray values becoming "invalid"

I m trying to show a database information in a tableview and then the detailed information in a view my problem is as follow: I created a NSMutableArray: NSMutableArray *myArray = [[NSMutableArray ...

iPhone numberpad with decimal point

I am writing an iPhone application which requires the user to enter several values that may contain a decimal point (currency values, percentages etc.). The number of decimal places in the values ...

热门标签