ios - Understanding how to use methods found in Apple Developer Reference documentation -
i've asked number of questions lately newbish. often, community answers questions leaving foot-note, "it's in apple documentation". truth is, don't understand how translate read in documentation real-world code. rely entirely on examples. i'd change this.
how invoke method found in apple developer reference documentation?
please explain steps in perspective of how go finding method want - implementing in project.
the first step read documentation very carefully. programming documentation terse , dense. every word significant. if there's piece of explanation of method don't understand, find meaning looking in related documents, on web (google has many programming mail lists indexed), or on stack overflow relevant question or code.
in case of example (now removed, realize), seem have missed @ least 1 important bit:
returns whether resource pointed file url
(emphasis mine), reinforced note:
this method applicable urls file system resources. other url types, method returns no.
you're trying pass url want check method, whereas method should called on url.
(a blunt aside, respectfully, if don't understand difference between last two, need book/tutorial, , can leave understanding how use docs until after that.)
the other thing -- whether docs clear or not -- trial , error. scribble test code looks should want, let run, , observe results. documentation, observe carefully. pay attention details. if don't understand results, again go hunting understanding. maybe tweak code, try different code, similar code on web, (again) related documentation.
those 2 things pretty it. go , forth between hunting , reading through docs , writing code , seeing until you've got program want.
Comments
Post a Comment