Skip to content
Browse files

Fixed slight logic error when disabling remind button

  • Loading branch information...
1 parent c258b90 commit 9652b1d86318d1e74fc15e818a471e87da09b56b @nicklockwood committed Nov 24, 2012
Showing with 5 additions and 25 deletions.
  1. +1 −1 Examples/Resizing Disabled/Classes/iRateAppDelegate.m
  2. +1 −2 README.md
  3. +3 −22 iRate/iRate.m
View
2 Examples/Resizing Disabled/Classes/iRateAppDelegate.m
@@ -29,7 +29,7 @@ + (void)initialize
//enable preview mode
[iRate sharedInstance].previewMode = YES;
-
+
//max out the text
[iRate sharedInstance].message = @"This long message demonstrates how the UIAlertView switches to using a scrolling panel when the text is too long unless the disableAlertViewResizing option is set to NO. It's even worse in landscape mode - try it!";
View
3 README.md
@@ -96,7 +96,6 @@ How long the app should wait before reminding a user to rate after they select t
The title displayed for the rating prompt. If you don't want to display a title then set this to `@""`;
-
@property (nonatomic, copy) NSString *message;
The rating prompt message. This should be polite and courteous, but not too wordy. If you don't want to display a message then set this to `@""`;
@@ -111,7 +110,7 @@ The button label for the button the user presses if they do want to rate the app
@property (nonatomic, copy) NSString *remindButtonLabel;
-The button label for the button the user presses if they don't want to rate the app immediately, but do want to be reminded about it in future. Set this to nil if you don't want to display the remind me button - e.g. if you don't have space on screen.
+The button label for the button the user presses if they don't want to rate the app immediately, but do want to be reminded about it in future. Set this to `@""` if you don't want to display the remind me button - e.g. if you don't have space on screen.
@property (nonatomic, assign) BOOL useAllAvailableLanguages;
View
25 iRate/iRate.m
@@ -77,10 +77,6 @@ @interface iRate()
@implementation iRate
-@synthesize message = _message;
-@synthesize messageTitle = _messageTitle;
-@synthesize remindButtonLabel = _remindButtonLabel;
-
#pragma mark -
#pragma mark Lifecycle methods
@@ -218,11 +214,6 @@ - (NSString *)messageTitle
return [_messageTitle ?: [self localizedStringForKey:iRateMessageTitleKey withDefault:@"Rate %@"] stringByReplacingOccurrencesOfString:@"%@" withString:self.applicationName];
}
-- (void)setMessageTitle:(NSString *)messageTitle
-{
- _messageTitle = messageTitle ?: @"";
-}
-
- (NSString *)message
{
NSString *message = _message;
@@ -233,11 +224,6 @@ - (NSString *)message
return [message stringByReplacingOccurrencesOfString:@"%@" withString:self.applicationName];
}
-- (void)setMessage:(NSString *)message
-{
- _message = message ?: @"";
-}
-
- (NSString *)cancelButtonLabel
{
return _cancelButtonLabel ?: [self localizedStringForKey:iRateCancelButtonKey withDefault:@"No, Thanks"];
@@ -250,12 +236,7 @@ - (NSString *)rateButtonLabel
- (NSString *)remindButtonLabel
{
- return [_remindButtonLabel length]? _remindButtonLabel: [self localizedStringForKey:iRateRemindButtonKey withDefault:@"Remind Me Later"];
-}
-
-- (void)setRemindButtonLabel:(NSString *)remindButtonLabel
-{
- _remindButtonLabel = remindButtonLabel ?: @"";
+ return _remindButtonLabel ?: [self localizedStringForKey:iRateRemindButtonKey withDefault:@"Remind Me Later"];
}
- (NSURL *)ratingsURL
@@ -730,7 +711,7 @@ - (void)promptForRating
delegate:(id <UIAlertViewDelegate>)self
cancelButtonTitle:self.cancelButtonLabel
otherButtonTitles:self.rateButtonLabel, nil];
- if (self.remindButtonLabel)
+ if ([self.remindButtonLabel length])
{
[alert addButtonWithTitle:self.remindButtonLabel];
}
@@ -753,7 +734,7 @@ - (void)promptForRating
otherButton:nil
informativeTextWithFormat:@"%@", self.message];
- if (self.remindButtonLabel)
+ if ([self.remindButtonLabel length])
{
[self.visibleAlert addButtonWithTitle:self.remindButtonLabel];
}

0 comments on commit 9652b1d

Please sign in to comment.
Something went wrong with that request. Please try again.