discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: infecting a C project with an NSDictionary


From: Adam Fedor
Subject: Re: infecting a C project with an NSDictionary
Date: Tue, 13 Apr 2004 22:08:50 -0600


On Apr 13, 2004, at 10:14 AM, Travis Griggs wrote:

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?


You would need to wrap the numbers in NSNumber objects and strings in NSString objects. You could also try using NSMapTable, and you would not have to do this wrapping. It's not really OO, but it is a smaller step and might get you started towards objectifying the program.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]