Objective-C Basic Class question -
So I'm returning to little programming and I can not find a good reference to understand the structure I am trying to do so, I am making no other movements and class objects like .. ...} ... @end
After having a class object within a class, should I initialize when the object is created in the main? I want to make sure that each instance created for the Mainrecord is always associated with its property (in the future it will be written in a file) all that is mainly readability and easy to add items to this category.
I recommend (at least part of), a guide published by Apple. The section called will answer all your questions.
Basically, you define not class methods to initialize the example variable in main ()
- which handle its variable Normal practice.) In Objective-C, you can initialize the example variable in a - (id) init
method and give them - (zero ) Dealloc
Method to avoid leaking of memory, for example, refer to all the -initWith ...
methods.
Comments
Post a Comment