Why is NSDocument reverting so rudimentary?

  • Hello,

      more out of curiosity, I wonder why document reverting  does not provide the
    same level of abstraction loading and writing does? There's only
    -revertToContentsOfURL:::. By contrast I can load and write documents by using
    abstract -readFromData::: and -dataOfType:: or  -readFromFileWrapper::: and
    -fileWrapperOfType:: methods and leave the actual file OS interaction to
    NSDocument. I basically don't have to care where it comes from or where it goes
    to. Wonderful!

    Am I overlooking something?

    Regards
    Markus
    --
    __________________________________________
    Markus Spoettl
  • Reverting a document calls through to -readFromURL:… internally.

    The read and write methods are primitive, and not intended to be called directly. The save, init, and revert methods are the higher level API designed for calling directly.

    On 24 Jul 2012, at 19:13, Markus Spoettl <ms_lists...> wrote:

    > Hello,
    >
    > more out of curiosity, I wonder why document reverting  does not provide the same level of abstraction loading and writing does? There's only -revertToContentsOfURL:::. By contrast I can load and write documents by using abstract -readFromData::: and -dataOfType:: or  -readFromFileWrapper::: and -fileWrapperOfType:: methods and leave the actual file OS interaction to NSDocument. I basically don't have to care where it comes from or where it goes to. Wonderful!
    >
    > Am I overlooking something?
    >
    > Regards
    > Markus
    > --
    > __________________________________________
    > Markus Spoettl
  • OK, thanks for setting me straight and sorry for the noise. I could have sworn
    it didn't work yesterday. It does.

    Regards
    Markus

    On 7/24/12 8:30 PM, Mike Abdullah wrote:
    > Reverting a document calls through to -readFromURL:… internally.
    >
    > The read and write methods are primitive, and not intended to be called
    > directly. The save, init, and revert methods are the higher level API
    > designed for calling directly.
    >
    > On 24 Jul 2012, at 19:13, Markus Spoettl <ms_lists...> wrote:
    >
    >> Hello,
    >>
    >> more out of curiosity, I wonder why document reverting  does not provide
    >> the same level of abstraction loading and writing does? There's only
    >> -revertToContentsOfURL:::. By contrast I can load and write documents by
    >> using abstract -readFromData::: and -dataOfType:: or
    >> -readFromFileWrapper::: and -fileWrapperOfType:: methods and leave the
    >> actual file OS interaction to NSDocument. I basically don't have to care
    >> where it comes from or where it goes to. Wonderful!
    >>
    >> Am I overlooking something?
    >>
    >> Regards Markus -- __________________________________________ Markus
    >> Spoettl
    >
    >

    --
    __________________________________________
    Markus Spoettl
previous month july 2012 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today