Obj-C header-file becoming C header-file, & NSImage problem
Obj-C header-file becoming C header-file, & NSImage problem
- Subject: Obj-C header-file becoming C header-file, & NSImage problem
- From: Oliver Donald <email@hidden>
- Date: Mon, 19 Jul 2004 09:58:27 +0100
Hi list,
I've got two questions which I've searched for on mamasam but found no
answer. I think the first one is stupidity on my part but I cant work it out
;)
1. In my current project I have a header file, PMTypes.h, that contains
definitions of many C structures. These structures are very small (mostly 3d
vector types) and are thrashed mercilessly, which is why I have avoided the
use of Objc Objects for these cases. One structure in particular is defined
as...
typedef struct
{
double t;
id intersectedObject;
}PMIntersectionStruct;
This structure is passed all over the place, and eventually comes back with
intersectedObject pointing at the lucky object. This had been working
perfectly, until I added PMTypes.c (for doing the vector manipulation
stuff), and included a C function prototype in PMTypes.h. Now, the compiler
always generates errors for the line 'id intersectedObject' in PMTypes.h. If
I change this to 'void *intersectedObject', it compiles and I can send
messages just fine, but I need to cast the void* to id in message sends to
avoid warnings. Its like the H file has been demoted from ObjC to C and the
compiler doesnt understand 'id' anymore. Is there some other way around
this?
2. I've got an NSImageView, made with an NSImage from a NSBitmapImageRep,
and a pointer to the bitmap data. If I change the data, the NSImageView only
updates to show the changes if the window (and view) is resized. How can I
get the NSImage view to update programmatically? Ive tried display: and
setNeedsDisplay: and various other methods on all the objects without
success :( Upon calling caching methods, I get an NSImageCacheException.
Thanks,
Oli
DISCLAIMER: The information contained in this e-mail is confidential and may
be privileged. It is intended for the addressee only. If you are not the
intended recipient, please delete this e-mail immediately. The contents of
this email must not be disclosed or copied without the sender's consent. We
cannot accept any responsibility for viruses, so please scan all
attachments. The statements and opinions expressed in this message are those
of the author and do not necessarily reflect those of the company. The
company does not take any responsibility for the views of the author.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.