Dictionary? Array? or other
Dictionary? Array? or other
- Subject: Dictionary? Array? or other
- From: Aaron Wallis <email@hidden>
- Date: Sat, 3 Sep 2005 23:41:26 +1000
Hi Fellow Cocoa Developers...
I've got a little pickle on my hands.
Im fairly new to Cocoa, but im quite familiar to oop development and
web languages, so im having a little bit of difficulty overcoming
some problems with a cocoa app im building.
I have a script that collects a large amount of data from a user,
each line entry that the user offers instantiates a object [ a custom
class I developed ] to manage the data, however, Im not to sure what
I should [ or can ] use to bind this data together?
for example, lets just say I have 100 objects that are created via a
loop.
I need each of those 100 objects to have a unique name, and then to
be stored in an array/dictionary/object whatever so I can reference &
call the objects methods at any given time...
I've had a stab at using NSMutableArrays and NSMutableDictionarys [as
the number of objects will change as the user interacts with the app]
however, I have always seemed to fail...
heres some of the code I am using to give you an idea of what im
trying to achieve:
// Create a expression object to relate to its properties
expressionEntry * tempExpression = [[ expressionEntry
alloc ] init]; <-- this is my custom class
[tempExpression setSeperator : splitStringBy ]; <-- feed
it some variables
[tempExpression setResult : splitStringResult ]; <-- feed
it more variables
// save the object into the array
[ expressionItems setObject: tempExpression
forKey:@"someUniqueID" ]; <-- this is where I would like to save the
objects for later use
Any help at all would be greatly appreciated !!!
Thanks
Aaron Wallis.
_______________________________________________
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