On Aug 16, 2015, at 4:49 PM, Ken Thomases wrote:

> On Aug 16, 2015, at 3:09 PM, Alex Zavatone <z...@mac.com> wrote:
> 
>> So, I look at UIStoryboard.h and the docs and see that there are 3 methods.  
>> No properties.
> 
>> And in using it, I find out that in addition to the 3 methods within 
>> UIStoryboard.h, inside a an instance of UIStoryboard, there are a bunch of 
>> properties that appear to be stupidly useful.
>> 
>> Like so:
>> designatedEntryPointIdentifier
>> identifierToNibNameMap
>> storyboardFileName
>> name
>> bundle
> 
>> This is really great.  I can see if any of my view controllers' scenes' 
>> identifiers are misspelled, I can see what Cocoa's using and verify where or 
>> if I screwed up somewhere.
>> 
>> This is really useful information.
>> 
>> Why isn't it in Apple's documentation for storyboards?
> 
> Because these are private implementation details.  They are subject to change 
> without notice.  You can't rely on them in any shipping code.

If they were private shouldn't there be a naming convention that states they 
are private?

If I look at an instance of a storyboard object in the Variables View in the 
Debugger, I can expand the object and they are all listed.

Is there some sort of naming or visual convention that communicates "you might 
be see these, but they're private and not for you to mess with"?

As soon as I saw them exposed by the runtime tool, and I saw that expanding the 
storyboard instance exposed them, I thought that the docs and header files were 
hiding information that was accessible.  

Is there anything that shows that they are private?  

>> Is it in Apple's documentation for storyboards but I don't know where to 
>> look?
>> 
>> If it is, what concept am I missing about understanding Apple's way of 
>> documenting their classes that would help me better understand how to look 
>> and where to look when researching?
> 
> The concept you're missing is the existence of private implementation details.
> 
>> I never would have known about these unlisted (yet accessible and valuable) 
>> properties unless I used a special tool to show what's in each object that 
>> derives from NSObject.
> 
> Because you weren't supposed to know about them.  That's why they're unlisted.
> 
>> That feels really really, um, deceiving (for lack of a better term).
> 
> The fact that classes can have private details is deceiving?  Or the fact 
> that Objective-C's run time allows introspection that reveals them?
> 
>> Am I doing it wrong?
> 
> Yes.  If it's not in the documentation or headers, you shouldn't be using it 
> (except for recreational/educational exploration or debugging).
> 

Yeah, in this case that leads to other questions of, "well, how can I get 
access to that functionality those private variables expose, because it's damn 
useful", but that's for another day.

Thanks Ken.



_______________________________________________

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Reply via email to