On Apr 3, 2009, at 7:06 AM, Mic Pringle wrote:

I did do some searching but it came up with nothing relevant. Perhaps
I was searching in the wrong place ?

Google finds everything you need with the terms you provided (when including the word "Cocoa" to narrow the scope), if you take the time to look through the results. That's how I found them.


Thanks for pointing out the example on Cocoa dev. However, it does not
show what I need.

Yes it does. You just have to take the time to research thoroughly so that you understand it. You can't just give up when the first results you find aren't a complete, drop-in solution. Don't understand a method? Then search for it. It's probably documented somewhere.


You see, in the code that gets the file attributes
to set on the folder, it uses this call ..

NSDictionary *attributes=[self fileAttributesToWriteToFile:newPath
                                                        ofType:docType
                                            saveOperation:saveType];

However, these is no code listing for fileAttributesToWriteToFile on
the page, and therefore I cannot see which attributes are getting set
?


  Like this right here.

The method you asked about is EASILY found by searching the documentation. You'll learn that it's an NSDocument method which was deprecated in 10.4, and that - fileAttributesToWriteToURL:ofType:forSaveOperation:originalContentsURL:error : is its replacement.

Following the handy link takes you straight to a nice method definition, complete with "Discussion" section that directly answers your question in the first several paragraphs, with references to more options.

Another term you should search for is "cross-referencing". Applying it will help you immensely in software development.

--
I.S.



On Apr 3, 2009, at 7:06 AM, Mic Pringle wrote:

Hi,

I did do some searching but it came up with nothing relevant. Perhaps
I was searching in the wrong place ?

Thanks for pointing out the example on Cocoa dev. However, it does not
show what I need. You see, in the code that gets the file attributes
to set on the folder, it uses this call ..

NSDictionary *attributes=[self fileAttributesToWriteToFile:newPath
                                                        ofType:docType
                                            saveOperation:saveType];

However, these is no code listing for fileAttributesToWriteToFile on
the page, and therefore I cannot see which attributes are getting set
?

Thanks

-Mic

2009/4/3 I. Savant <idiotsavant2...@gmail.com>:
On Apr 3, 2009, at 6:25 AM, Mic Pringle wrote:

How would one go about creating a folder that would appear to the
finder as a bundle/package ?

Have you searched the archives? The documentation? Google, perhaps? While no longer a *frequently* asked question, it's been asked countless times and there're even some examples on cocoadev.com and other places. Please search
before posting.

Getting the appearance is as easy as flipping a switch when you declare your document types. Managing reading/writing the package is a bit more involved, but cocoadev's example works well. The format has to be just so in
order for Finder to realize it's a package.

http://www.cocoadev.com/index.pl?SavingFilePackageWithManySmallIndependentFiles

--
I.S.



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to