RE: Swapping isa's (was Re: Hex Edit controls (resknife))
RE: Swapping isa's (was Re: Hex Edit controls (resknife))
- Subject: RE: Swapping isa's (was Re: Hex Edit controls (resknife))
- From: Jeff Laing <email@hidden>
- Date: Fri, 3 Dec 2004 08:24:16 +1100
> Uli just pointed me to this thread, so I figured I would chip
> in. Sorry
> for crashing the party so late on! It seems you guys managed
> to figure
> out why I originally chose to swap the isa pointer (evil IB bugs with
> NSTextView subclasses) so I won't bother mentioning that.
The odd thing is that no-one else has been able to reproduce my problem,
although it seems that you did. Perhaps the others needed to bang on their
nibs a little more - whilst it seemed very predictable to me, it did involve
multiple actions before it fell apart.
> > Of course, one should never lose sight of the fact that I
> was able to
> > take
> > the code from ResKnife (including its nib) and weld it into
> my Cocoa
> > project
> > in about two hours, and it worked enough to prove the
>
> Two hours is rather long. Could you suggest ways I could improve the
> reusability of the class?
I am using it to display a fixed-size hex block, which is already being
mapped into memory by some other pre-existing logic. Rearranging the editor
to look into my other data structures rather than expect an NSData to be
passed in, or worse, an object of type 'resource' which responds to [...
data] messages took a little time. (I'm not proud of my memory mapper at
the moment, it also needs a rewrite due to the clunky way you need to work
with it, so its not ResKnifes fault)
It seems to me that what you have is focused on being a plugin to a resource
editor which is exactly right for what it wants to be. I, on the other
hand, need it to be a lot more constrained about what it will allow you to
edit, but a lot freer on what its prepared to edit.
For example, changing the number of bytes in the data is a no-no. Thus, you
can't just type characters at the end, nor can you accept just any paste.
What I'm aiming for is a drop-in NSControl that would actually encapsulate
the three offset, hex and ascii subcontrols. I'd rather it worked off an
(unsigned char*, size_t) pair than an NSData because that fits my
application better.
But for now, it works well enough and lets me focus on the actual
application, rather than its underpinnings...
> And you're very welcome. When I was starting out, sample code was very
> important as I had no books and was self-taught. I wanted to allow
> others the same opportunity. (And I had no idea what Open Source
> Software was at the time).
> I do request that I be credited somewhere if it gets used in someone
> else's software though.
Already planned.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden