Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextEditor sample: toolbarItemsForDocument: unused parameter? #67

Open
memmons opened this issue Apr 19, 2013 · 1 comment
Open

TextEditor sample: toolbarItemsForDocument: unused parameter? #67

memmons opened this issue Apr 19, 2013 · 1 comment

Comments

@memmons
Copy link

memmons commented Apr 19, 2013

The AppController's toolbarItemsForDocument: parameter is not being used in the TextEditor sample. In addition the following comment appears in it:

// Cache document toolbar items. These must *only* target the given object (not the document) 
   so that we can reuse them.

Is the OUIDocument parameter legacy code that wouldn't typically be used or is the TextEditor samle a special case where it's not needed?

@tjw
Copy link
Contributor

tjw commented Apr 19, 2013

Yeah, that comment seems pretty unclear. It would be better written as "Since we are caching these toolbar items, the must target the receiver and not the passed in document."

Looking through our apps, I don't see anywhere that we are currently making use of the document argument. I don't recall off hand if we ever did (say, to return a different set of toolbar items for different document types) or whether we were being 'helpful' by passing it.

Caching these toolbar items seems like a dubious optimization, really.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants