iphone - NSString is not getting added to NSMutableArray -
-(ibaction)orderbuttonpressed { mystring = staterlabel1.text; [myarray addobject:mystring]; nslog(@"wat in %@",myarray); } -(ibaction)orderbutton2pressed { mystring2 = staterlabel2.text; [myarray addobject:mystring]; nslog(@"wat in %@",myarray); }
after clicking button text in mystring
should add nsmutablearray
object myarray
, not happen. doing wrong?
you have typo
(ibaction)orderbuttonpressed { mystring = staterlabel1.text; [myarray addobject:mystring]; nslog(@"wat in %@",myarray); } -(ibaction)orderbutton2pressed { mystring2 = staterlabel2.text; [myarray addobject:mystring2]; // <-- change here nslog(@"wat in %@",myarray); }
in second method need add mystring2
not mystring
Comments
Post a Comment