#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 what is cognac made?",@"What is 8 + 8 ?",@"What is the 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解决方法 使用ARC自动进行内存管理.您是否收到了输出中的内存警告日志?如果没有,那么你没事.除此之外,我认为这是正常的. 总结
以上是内存溢出为你收集整理的iOS应用内存使用量在Xcode中持续增长全部内容,希望文章能够帮你解决iOS应用内存使用量在Xcode中持续增长所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)