This kind of mismatch, that is, the NSNumber type of the assignment to the string itself is not known, because my test, the code is as follows (VIEWCONTROLLER.M)
-(void) Viewdidload {
[Super Viewdidload];
BankAccount = [[Bankobject alloc] init];
[BankAccount setvalue:@ "ten" forkey:@ "account"];
[BankAccount addobserver:self forkeypath:@ "account" options:nskeyvalueobservingoptionnew| Nskeyvalueobservingoptionold Context:nil];
_mylabel = [[UILabel alloc] initwithframe:cgrectmake (100, 100, 200, 100)];
_mylabel.text = [BankAccount valueforkey:@ "account"];
_mylabel.textcolor = [Uicolor Whitecolor];
[Self.view Addsubview:_mylabel];
_mybutton = [UIButton buttonwithtype:uibuttontyperoundedrect];
_mybutton.frame = CGRectMake (200, 300, 100, 50);
_mybutton.backgroundcolor = [Uicolor Redcolor];
[_mybutton addtarget:self Action: @selector (ChangeAccount) forcontrolevents:uicontroleventtouchupinside];
[Self.view Addsubview:_mybutton];
}
Break point, is also the program after the execution of Viewdidload will not collapse, unaware of _mylabel.text = [BankAccount valueforkey:@ "Account"]; This error, changed to _mylabel.text = [ NSString stringwithformat:@ "%@", [BankAccount valueforkey:@ "Account"]; it's OK.
-[__nscfnumber Rangeofcharacterfromset:]: Unrecognized selector sent to instance 0x7fa5216589d0