@property NSMutableArray WebsiteQueue, WebpageQueue;
thank you so much for your help. i appreciate that.
when where is the best place to initialize variables? do i have to define a new init function ?
Ranting…
except in *many* other languages you can instantiate your instance variables at the same time as declaring them. Your rant seems a little bit OTT.
In answer to the original question, yes, the best place to instantiate variables that need to live as long as the container class is in a custom init method. Make sure to release them in your class' dealloc method if you're not running under ARC or garbage collection.
sch.h
@interface sch: NSObject {
NSMutableArray *_websiteQueue;
NSMutableArray *_webpageQueue;
}
@end
[B]Your sch.m[/B]
@implemetation
-(void)whateverMethod{
//Now you can alloc and init your instance
_websiteQueue = [[NSMutableArray alloc] initWithCapacity:2];
_webpageQueue = [[NSMutableArray alloc] initWithCapacity:2];
//Now you can add,remove,replace objects etc from your array sense it's Mutable.
}