Quote:
Originally Posted by korki696
Hey Smasher,
Thanks for the reply. I do have a quick question. In my code I am just calling
[[TTLauncherItem alloc] init]
In yours you had defined all of your variable. How would i do it in my case?
Thanks
-Korki
|
I assume you mean inside initWithCoder? [[TTLauncherItem alloc] initWithCoder: theCoder] will get called by the system when you load the array from the file. You need to make sure the initWithCoder method you write will init the object and set the variables based on what's in the file.
Inside my initWithCoder method I call [self init] to call the regular init method first, and then I set all of the variables based on the info I get from the coder. In your case you have a different init method you want to call, so you would get the info from the coder and then call that init method:
Code:
[self initWithTitle: savedTitle
image: savedImage
URL: saveURL];