Re: Class generator script
Re: Class generator script
- Subject: Re: Class generator script
- From: Adam <email@hidden>
- Date: Sun, 2 May 2004 20:53:26 -0400
Well, I am new to Obj-C and coming from Java I am used to a class for
everything. I will briefly describe my design. If there is a better way
I would like to know.
I have a class "player" who needs to have a verity of properties
associated with him NSString, int, bool, etc...
I need to be able to dynamically create these objects as the app is
running and new players join the server
Then I add instances of the player object to an array so the properties
can be displayed in an NSTableView.
Adam
On May 2, 2004, at 4:12 PM, Ondra Cada wrote:
Adam,
On 2.5.2004, at 21:33, Adam wrote:
Hmm, perhaps then I am missing something. I am talking about "model"
classes that I am creating by hand. I have a class with 10 variables
that need a constructor, and getters and setters. Can IB do this for
me?
First, consider refactoring: I *DO NOT* say your design is wrong for I
don't know it, but *generally* in Cocoa you make a lot less number of
classes than elsewhere. Consider using such great things like property
lists (dictionary/array nested structures) or so.
If you really need to, there is a number of accessor generators (just
search Versiontracker; for one, I believe some nice scripts for that
are part of TextExtras, which is a tool I *do* recommend anyway), or
you can use your own macros (which brings its own advantages and
drawbacks both).
Myself, I've found I'm happiest writing my accessors myself, but I
*VERY* heavily use property lists for engine.
---
Ondra Hada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
[demime 0.98b removed an attachment of type
application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.
_______________________________________________
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.