Quick fixes to make this a tad nicer/safer.#5
Open
uliwitness wants to merge 6 commits intojivadevoe:masterfrom
Open
Quick fixes to make this a tad nicer/safer.#5uliwitness wants to merge 6 commits intojivadevoe:masterfrom
uliwitness wants to merge 6 commits intojivadevoe:masterfrom
Conversation
…efix. NSTimer is the only one to have userInfo typed as 'id', but since NSException, NSError, NSNotification etc. all expect it as an NSDictionary, this seems to make for less surprise.
…w, I’ve tested it :-)
Author
|
Huh. Somehow it included the ARC merge I made after doing this pull request. That wasn't intended. But if you want, merge that too. I think it's nice and small. |
|
👍 I came here to say the very same thing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Your category name (and filename, but that I can influence by placing your file in a subfolder) is unsafe. If I add another framework that uses similar utility code, I may get a collision and not even notice it. So I've prefixed the category name. Ideally, the files would be named "NSTimer+JDBlocks.*" as well, but I presume that'd break stuff for you at this point.
I also moved the timer into a dictionary. Not strictly necessary, but provides for less surprise (all other classes restrict userInfo to dictionaries). And finally, found a trailing ';' in an implementation that I cleaned up.
All these edits were done on Github, so I hope this still compiles.