Change font size via UiBarButtonItem in UITextView, works just once
问题 I have UiTextView where I want change font size (increase), here code -(void)biggerFont:(UIBarButtonItem *) item { CGFloat i = [UIFont systemFontSize]; textView.font = [UIFont fontWithName:@"Tahome" size:i]; i+=2; } But it works just once, if you push once and after that again - fon size won't change. Help me please 回答1: It's easy you are not saving the state of i persistently. Everytime you set i to the same value. After the method has been run through i is discarded cause it only exists in