• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
save to file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

save to file


  • Subject: save to file
  • From: simone gabbriellini <email@hidden>
  • Date: Thu, 3 Mar 2005 19:46:03 +0100

In my .h file I have those textfields

@interface
MyDocument : NSDocument
{
IBOutlet NSTextField *contenutoInvito;
IBOutlet NSTextField *immagineInvito;
IBOutlet NSTextField *messaggioInvito;
IBOutlet NSTextField *titoloInvito;

NSMutableArray *arrayInvito;

}


I use this code to save the file with the textfield contents, but it doesn't seem to work

-(void)encodeWithCoder:(NSCoder *)coder
{
[arrayInvito initWithCapacity:3];
[arrayInvito insertObject:messaggioInvito atIndex:0 ];
[arrayInvito insertObject:titoloInvito atIndex:1 ];
[arrayInvito insertObject:contenutoInvito atIndex:2 ];
[arrayInvito insertObject:immagineInvito atIndex:3 ];

[coder encodeObject:arrayInvito];
}

- (NSData *)dataRepresentationOfType:(NSString *)aType
{
// saving data
if([aType isEqualToString:@"invitiEase"]){
return [NSArchiver archivedDataWithRootObject:self];
}
return nil;
}

any hint about what's wrong? is it correct to store a text field inside an array?

thanx
simone
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: save to file
      • From: "John C. Randolph" <email@hidden>
  • Prev by Date: Re: Connecting to iSeries/AS400
  • Next by Date: Re: keyDown:not receiving Command + key events, space bar, left/right arrows
  • Previous by thread: NSFormatter workings question
  • Next by thread: Re: save to file
  • Index(es):
    • Date
    • Thread