iphone - iOS app memory usage keeps going up in Xcode -
i'm new ios programming , have built iphone app can ask user question , return answer. building environment os x 10.9 , xcode 5.0.2. every time starts iphone simulator, debug navigator shows memory usage 13.5mb keeps going after returned home screen. after minute memory usage become stabilized around 17.5mb. normal behavior or need add memory management code?
#import "quizviewcontroller.h" @interface quizviewcontroller () @property (nonatomic) int currentquestionindex; @property (nonatomic, copy) nsarray *questions; @property (nonatomic, copy) nsarray *answers; @property (nonatomic,weak) iboutlet uilabel *questionlable; @property (nonatomic,weak) iboutlet uilabel *answerlable; @end @implementation quizviewcontroller - (instancetype) initwithnibname:(nsstring *)nibnameornil bundle:(nsbundle *)nibbundleornil { self = [super initwithnibname:nibnameornil bundle:nibbundleornil]; if(self){ self.questions = @[@"from cognac made?", @"what 8 + 8 ?", @"what capital of minnesota?"]; self.answers = @[@"grapes", @"16", @"st.paul"]; } return self; } - (ibaction)showquestion:(id)sender { self.currentquestionindex++; if (self.currentquestionindex == [self.questions count]){ self.currentquestionindex = 0; } nsstring *question = self.questions[self.currentquestionindex]; self.questionlable.text = question; self.answerlable.text = @"???"; } - (ibaction)showanswer:(id)sender { nsstring *answer = self.answers[self.currentquestionindex]; self.answerlable.text = answer; } @end
memory management automatic arc. getting did receive memory warning log in output? if not fine. other think normal.
Comments
Post a Comment