ios - whats wrong with this code im trying to change a label text with NSString and NSLog? -
im trying simple, im trying change label "i hi" clicking button. know how without nsstring wanted make more harder cant find whats wrong code not working.
- (ibaction)button:(id)sender{ nsstring *hi = @"hi"; _label.text = nslog(@"i %@", hi); }
im trying more complicated , use void statement work , if not whats wrong it
- (void)num{ int num = 42; } - (ibaction)button:(id)sender{ _label.text = nslog(@"i %i", num); }
why trying use nslog
this? that's showing messages in log.
you want nsstring stringwithformat:
.
_label.text = [nsstring stringwithformat:@"i %@", hi);
what have won't compile since nslog
function not return nsstring
value.
Comments
Post a Comment