Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Basic inter class relationship question for Cocoa / Objective-C

Basic inter class relationship question for Cocoa / Objective-C
Thread Tools
Registered User
Join Date: Feb 2003
Status: Offline
Reply With Quote
Jul 7, 2004, 07:53 AM
 
OLD post deleted - I am Learning objective-c tried to bite of to much. But am still working on it. If you are interested in answer some of my questions see below. For my on going questions.

If an admin can rename this post to "Assorted questions on Cocoa / Objective-C" it would be much appreciated.
(Last edited by depolitic; Jul 8, 2004 at 10:55 PM. )
     
Registered User
Join Date: Feb 2003
Status: Offline
Reply With Quote
Jul 8, 2004, 05:56 AM
 
bump - I am just looking for a pointer in the right direction. Anyone?

I believe that I need to pass the NSDictionary values into my Archiver method but no matter were I place my -(Void)setName: setEmail: method I just get nothing. No file is written out and no error is thrown.

What am I missing??
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Jul 8, 2004, 06:50 AM
 
I'm not entirely sure what you're doing. I'll point out a few things I noticed in hopes that one of them relates to your problem:
  • You are not calling to super in your -[Controller init] method. Unless this is a root class, you have to call [super init] in order to keep the inheritance chain working.
  • I don't know what firstNameField and emailField are, but they aren't set as far as I can tell, so you're setting the name and e-mail in KeyArchiver to nil.
  • Setters (such as setName:setEMail:) need to perform memory management. It's entirely possible that those strings will disappear right out from under you if you don't retain them.
  • Archiving a set of strings seems unnecessary. Why not just write out a dictionary as a plist?
  • I don't know why you expect anything you do in your table view to relate to all that stuff in main. It's all finished by the time your table view has been created.
  • You should check the return value of archiveRootObject... if it seems like you're having trouble there.
(Last edited by Chuckit; Jul 8, 2004 at 07:40 AM. )
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Registered User
Join Date: Feb 2003
Status: Offline
Reply With Quote
Jul 8, 2004, 07:20 AM
 
wow thanks - it will take me some time to look into all your points.

Why am I using archiving just for practice, plus I was told that plist could only store limited amount of data. But how much is to much I am unsure.

I think I am biting of more then I can chew. I think I should step back into something simpler.

I will get back to you
(Last edited by depolitic; Jul 8, 2004 at 07:58 AM. )
     
Registered User
Join Date: Feb 2003
Status: Offline
Reply With Quote
Jul 8, 2004, 10:50 PM
 
hidden
(Last edited by depolitic; Jul 8, 2004 at 11:08 PM. )
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:39 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2