Friday, 15 April 2011

ios - ARC , attach char* to label.text through stringWithFormat , the 'live bytes' grows little by little till crash -



ios - ARC , attach char* to label.text through stringWithFormat , the 'live bytes' grows little by little till crash -

i'm using arc .

.h file

@property (weak, nonatomic) iboutlet uilabel *label; - (ibaction)onbuttonclick:(id)sender;

.m file

- (ibaction)onbuttonclick:(id)sender { char *example = "testabcdef"; _label.text = [nsstring stringwithformat:@"%s",example]; }

i find 'live bytes' in instrument grows little when 'onbuttonclick' called every time , , never drop down, code in app cause app crash after hundreds of calling because of 'received memory warning, , out of memory'.

i'v been confused question 2 month. still don't know why? can help me?

ios memory automatic-ref-counting didreceivememorywarning stringwithformat

No comments:

Post a Comment