• 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
Re: How to make a custom file format
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to make a custom file format


  • Subject: Re: How to make a custom file format
  • From: Adam Knight <email@hidden>
  • Date: Thu, 20 Jul 2006 23:51:58 -0500

Well, you need to actually implement readFromFileWrapper rather than just telling it to return true. Returning true indicates that you've done what's needed to load the proper data from the file, and you haven't done that. I'd look at the NSPersistentDocument documentation on how to use non-standard store types for more information on that part.
--
Adam Knight
If you're not going to stop and appreciate the scenery, you're not going to
enjoy Myst. The same thing applies on the Mac as well. -- Rand Miller




On Jul 20, 2006, at 9:11 AM, malcom wrote:

Hello,
I would to add a new file type into my app. It's basically a folder
where I need to read some files. I've tried to add the file format
extensions inside my plist as you can see from this screenshot:

http://img236.imageshack.us/img236/8366/immagine7bb3.png

Unfortunatly If I take a folder and I try to add my fformat suffix the
folder still remain a folder. So I've add a class (ANTFileReader) to
my file format class.
This is the implementation:

@implementation ANTFileReader

+ (NSArray *)readableTypes {
	return [NSArray arrayWithObjects:@"msgnemo",nil];
}

+(NSArray*)writableTypes {
	return [NSArray arrayWithObjects:@"msgnemo",nil];
}

- (BOOL)readFromFileWrapper:(NSFileWrapper *)fileWrapper
ofType:(NSString *)typeName error:(NSError **)outError {
	return YES;
}

@end


It works fine and now the folder is a 'fake-file'. But when I try to launch my app this is the result:

http://img163.imageshack.us/img163/9533/immagine8ql2.png
http://img163.imageshack.us/img163/6748/immagine9lw9.png

What's wrong?  Need I to implement other methods? Thanks
_______________________________________________
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


_______________________________________________ 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
References: 
 >How to make a custom file format (From: malcom <email@hidden>)

  • Prev by Date: Re: bindings, tables and custom sort selector
  • Next by Date: Re: Watching System Configuration
  • Previous by thread: How to make a custom file format
  • Next by thread: Error with core data fetch requests: subentitiesByName misapplied, and segfaults
  • Index(es):
    • Date
    • Thread