Skip to content

Commit

Permalink
Uses consistently properties, not ivars, in Objective-C AnalyticsExample
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriyvan committed Oct 24, 2017
1 parent c71fe38 commit f52252a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion analytics/AnalyticsExample/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
// [END configure]

// Set a white background so that patterns are showcased.
_window.backgroundColor = [UIColor whiteColor];
self.window.backgroundColor = [UIColor whiteColor];

return YES;
}
Expand Down
6 changes: 3 additions & 3 deletions analytics/AnalyticsExample/FoodPickerViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ - (void)viewDidLoad {

- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row
inComponent:(NSInteger)component {
NSString *food = _foodStuffs[row];
NSString *food = self.foodStuffs[row];

[[NSUserDefaults standardUserDefaults] setValue:food forKey:@"favorite_food"];
[[NSUserDefaults standardUserDefaults] synchronize];
Expand All @@ -58,13 +58,13 @@ - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
}

- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
return _foodStuffs.count;
return self.foodStuffs.count;
}

- (NSString *)pickerView:(UIPickerView *)pickerView
titleForRow:(NSInteger)row
forComponent:(NSInteger)component {
return _foodStuffs[row];
return self.foodStuffs[row];
}

@end

0 comments on commit f52252a

Please sign in to comment.