1. Initialization
2. Common methods
Stitching strings
Determine if the same string
[Answer Isequaltostring:self.currentmodel.answer]//answer==self.currentmodel.answer Difference
3. Comparison of methods
Nssttring stringbyappendingstring//nsstring Immutable, each append generates a new NSString
Nsmulbtblestring AppendString//nsmulbtblestring operation itself
1 __block NSString * answer = [nsstring new]; 2[Self.answerView.subviews enumerateobjectsusingblock:^ (__kindof UIView * _nonnull obj, Nsuinteger idx, BOOL *_nonnull stop) {3UIButton * button = (uibutton*) obj;4 answer = [Answer stringByAppendingString:button.currentTitle]; 5 }];6 7 8 9 __block nsmutablestring * answer = [nsmutablestring string]; Ten[Self.answerView.subviews enumerateobjectsusingblock:^ (__kindof UIView * _nonnull obj, Nsuinteger idx, BOOL *_nonnull stop) { OneUIButton * button = (uibutton*) obj; A [Answer AppendString:button.currentTitle]; -}];
OC NSString Summary