English 中文(简体)
t create 否
原标题:Can t create an NSImage?

每当我去做:

xxx = [NSImage imageNamed:@"Package.png"];

<>xxx> /strong> 载荷,但宽度和高度仍保持。 0. 每当我试图将其装入NSImageCell时,我就发现这一错误:

NSImageCell的物体价值必须是NSImage。

谁能帮助我? 我从未有过这个问题。

Edit:Sorry, I veewthe bit out.。 因此,如果我在数据来源中投了票,它就没有工作,而是在return cell;之后显示出上述错误。

NSImageCell* cell = [[NSImageCell alloc] init];
[cell setObjectValue:xxx]; // Using imageNamed doesn t help either

第2号:正在恶化。 我不理解所发生的事情,但图像负荷高,质量高,但当我向NSImageCell补充时,我仍然抱怨。

“alt

最佳回答

我看到——因此,表格中的观点毕竟是相关的。

作为数据来源,你的工作是归还(在用户编辑的情况下接收)各栏中各单元的标值。

但是,你没有恢复这种价值;你重新回到了牢房。 因此,你再次试图将图像电池(由数据来源重新分类)作为图像电池(现有一栏所有)的价值。

日志信息表明,在你设立一栏时,你已经将一栏的电池作为图像电池,因此,现在你们都需要改变数据来源,以便永远归还该栏的标值,而不是一个电池。 图像一栏的图像回归。 案文一栏,重述。

注 观点并不如UITableView,即UITableViewCells,你在屏幕上拥有多达多个囚室;在NSTableView中,每个NSTableColumn获得,只有一个数据电池,而且一个囚室被用在每排一个囚室里。 电池的标值是你向电池提供的,你从数据来源方法将其(标值)归还给电池。

关于控制的文件(NSTableView是一种NSControl)及其小组是:,Control和单元方案规划指南

问题回答

我的猜测是返回的<代码>nil,在这种情况下,带宽/秒将返回。 页: 1

Try:

xxx = [NSImage imageNamed:@"Package"]; // the extension is not needed on the desktop or iOS 4

并且确保图像实际上被复制到你的应用资源中!

在确定你事实上是接受“NSImage”检查(而不是nil),其宽度和高度为零之后,下一步是确定为何发生这种情况。

  1. Can you open Package.png in Preview?
    1. If so: What s its width and height in Preview s Info window? Does it have any resolution (DPI or pixels-per-meter) information? If so, what does that say?
    2. If you crack open your application bundle, can you open that copy of Package.png in Preview?
  2. When you log the description of the image, what s the output?
  3. What s the output of logging the image s representations array? (This should be included in the image s own description, but I include it explicitly in case not.)
  4. What happens if you delete your build folder and re-build?




相关问题
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 ...

热门标签