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

Code cleanup for your pull request #1

Merged
merged 4 commits into from
Oct 22, 2014
Merged

Conversation

skywinder
Copy link

No description provided.

@@ -293,10 +293,10 @@ - (IBAction)customButtonPressed:(id)sender
NSDictionary *buttonDetails = (self.customButtons)[(NSUInteger) index];
NSAssert(buttonDetails != NULL, @"Custom button dictionary is invalid");

ActionType actionType = [buttonDetails[kActionType] intValue];
ActionType actionType = (ActionType) [buttonDetails[kActionType] integerValue];
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

по поводу integerValue: Конечно typedef int NSInteger;
Но лучше всегда использовать родные типы данных. Тем более "вдруг" измениться архитектура и NSInteger станет уже long int (к примеру)?

По поводу каста к типу ActionType - это нужно для проверок на этапе компиляции. AppCode такие вещи сразу подсвечивает и при курсоре на этих участках и нажатии Alt + Enter сразу правит.

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

Successfully merging this pull request may close these issues.

2 participants