Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 03-15-2010, 04:30 PM   #4 (permalink)
smasher
Senior Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 3,858
Default

Quote:
Originally Posted by korki696 View Post
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];
__________________

Free Games!
smasher is offline   Reply With Quote
 

» Advertisements
» Online Users: 276
18 members and 258 guests
ADY, apatsufas, BdR, ckgni, F_Bryant, glenn_sayers, Guthook, ilmman, joeallenpro, ketaskin, michelle, Music Man, NSeven, smethorst, Sunny46, TheWebWizz, zbynda, ziocleto
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,876
Threads: 89,225
Posts: 380,709
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jorge599
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 08:10 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.