[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
infecting a C project with an NSDictionary
From: |
Travis Griggs |
Subject: |
infecting a C project with an NSDictionary |
Date: |
Tue, 13 Apr 2004 09:14:53 -0700 |
User-agent: |
Mozilla Thunderbird 0.5 (X11/20040321) |
I'm maintaining/evolving a relatively complex/legacy C app. Like many
apps, it grew over its life cycle, and did so in an interesting way. One
way is that amongst various querying/setting commands, it has generic 2D
arrays of "parameters" and "counters". Different "modes" in the
application have different interpretations for which cells mean what in
these tables. Pretty classic hacked up legacy C code design. :)
So I'm having to add yet another mode to this system. And I've just had
it with this blob of 2D cells. The veteran Smalltalker in me knows
there's a better way, and its name is Dictionary. So I'd like to infect
my new mode, and eventually the rest of the system, slowly replacing the
2D array with dictionaries of named entries.
These arrays have traditionally been just int32's. To store these in the
Dictionary, I have to wrap them huh? Also, I want to use Strings as the
keys. Can I just use char*'s for these, or do I have to cast them into
NSStrings--I was hoping maybe the conversion was automatic :). And what
about memory management. Any other hints/suggestions on how to architect
this, which APIs to use? What do I need to do keep memory safe?
TIA
--
Travis Griggs
Objologist
Key Technology
Achille's Heel?!?! What about "Goliath's Forehead"
-----------------------------------------
This email message is intended only for the addressee(s) and contains
information that may be confidential to and/or copyrighted by Key Technology.
If you are not the intended recipient, please notify the sender by reply email
and immediately delete this email. Use, disclosure or reproduction of this
email by anyone other than the intended recipient(s) is strictly prohibited.
Any views expressed in the email are those of the individual sender unless the
sender expressly states them to be the views of Key Technology. No
representation is made that this email or any attachments are free of viruses.
Virus scanning is recommended and is the responsibility of the recipient.
- infecting a C project with an NSDictionary,
Travis Griggs <=