收到内存警告。 1级 [英] received memory warning. level 1

查看:82
本文介绍了收到内存警告。 1级的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是iPhone开发的新手。我正在创建一个应用程序,我需要以编程方式创建按钮和标签。

所以我在.h文件中这样做

  @interface FirstQuizViewControlleriPad:UIViewController {

IBOutlet UIButton * startgame;
UILabel * theQuestion;
IBOutlet UIScrollView * scrollview;
UILabel *问题;
UILabel *描述;
UIView * ContainerView;
UILabel * Challengetext;
UIImageView * img1;
UIImageView * img2;
UIImageView *背景;
IBOutlet UIButton * reviewbtn;
UILabel * ans1;
UILabel * ans2;
UILabel * ans3;
UILabel * ans4;

UIButton *按钮;
UIButton * button2;
UIButton * button3;
UIButton * button4;
UILabel * rightans;
UILabel * theScore;
UIButton * nextbtn;
UIButton * backbtn;
NSString * setchallange;

AVAudioPlayer * AVback;
AVAudioPlayer * AVstart;
NSArray * theQuiz;
NSInteger questionNumber;
NSInteger rightAnswer;
NSInteger myScore;
NSInteger finalScoreipad1;
BOOL restartGame;
id QuestionReview;

}

@property(保留,非原子)IBOutlet UIButton * startgame;
@property(保留,非原子)NSArray * theQuiz;
@property(保留,非原子)IBOutlet UILabel * theScore;
@property(保留,非原子)IBOutlet UIButton * nextbtn;
@property(保留,非原子)IBOutlet UIScrollView * scrollview;
@property(保留,非原子)IBOutlet UIButton * backbtn;
@property(保留,非原子)IBOutlet UILabel * Challengetext;
@property(保留,非原子)IBOutlet UIImageView * img1;
@property(retain,nonatomic)IBOutlet UIImageView * img2;
@property(保留,非原子)id QuestionReview;
@property(保留,非原子)IBOutlet UIButton * reviewbtn;
@property(保留,非原子)IBOutlet UIButton *按钮;
@property(保留,非原子)IBOutlet UIButton * button2;
@property(保留,非原子)IBOutlet UIButton * button3;
@property(保留,非原子)IBOutlet UIButton * button4;
@property(保留,非原子)IBOutlet UILabel * ans1;
@property(保留,非原子)IBOutlet UILabel * ans2;
@property(保留,非原子)IBOutlet UILabel * ans3;
@property(保留,非原子)IBOutlet UILabel * ans4;
@property(保留,非原子)IBOutlet UILabel *问题;
@property(retain,nonatomic)NSString * setchallange;

- (void)askQuestion;

.m文件中的

  questionNumber = questionNumber + 1; 
NSInteger row = 0;
if(questionNumber == 1)
{
row = questionNumber - 1;
}
其他
{
row =((questionNumber - 1)* 10);
}

NSString * selected = [theQuiz objectAtIndex:row];
NSString * activeQuestion = [[NSString alloc] initWithFormat:@%@,已选中];
QuestionReview = activeQuestion;

// lbl ref to btn1
ans1 = [[[UILabel alloc] initWithFrame:CGRectMake(36,292,697,100)] autorelease];
ans1.numberOfLines = 0;
ans1.font = [UIFont systemFontOfSize:26];
ans1.text = [theQuiz objectAtIndex:row + 1];
ans1.lineBreakMode = UILineBreakModeWordWrap;
[ans1 sizeToFit];
[self.view addSubview:ans1];
// lbl ref to btn2
ans2 = [[[UILabel alloc] initWithFrame:CGRectMake(36,312 + ans1.frame.size.height,697,100)] autorelease];
ans2.numberOfLines = 0;
ans2.font = [UIFont systemFontOfSize:26];
ans2.text = [theQuiz objectAtIndex:row + 2];
ans2.lineBreakMode = UILineBreakModeWordWrap;
[ans2 sizeToFit];
[self.view addSubview:ans2];
// lbl ref to btn3
ans3 = [[[UILabel alloc] initWithFrame:CGRectMake(36,332 + ans1.frame.size.height + ans2.frame.size.height,697,100) ] autorelease];
ans3.numberOfLines = 0;
ans3.font = [UIFont systemFontOfSize:26];
ans3.text = [theQuiz objectAtIndex:row + 3];
ans3.lineBreakMode = UILineBreakModeWordWrap;
[ans3 sizeToFit];
[self.view addSubview:ans3];
// lbl ref to btn4
ans4 = [[[UILabel alloc] initWithFrame:CGRectMake(36,352 + ans1.frame.size.height + ans2.frame.size.height + ans3.frame。 size.height,697,100)] autorelease];
ans4.numberOfLines = 0;
ans4.font = [UIFont systemFontOfSize:26];
ans4.text = [theQuiz objectAtIndex:row + 4];
ans4.lineBreakMode = UILineBreakModeWordWrap;
[ans4 sizeToFit];
[self.view addSubview:ans4];

rightAnswer = [[theQuiz objectAtIndex:row + 5] intValue];

问题= [[[UILabel alloc] initWithFrame:CGRectMake(22,130,725,160)] autorelease];
Question.numberOfLines = 0;
//Question.font = [UIFont systemFontOfSize:27];
Question.text = activeQuestion;
Question.lineBreakMode = UILineBreakModeWordWrap;
[Question setFont:[UIFont fontWithName:@Futurasize:26]];
Question.backgroundColor = [UIColor clearColor];
[问题sizeToFit];
[self.view addSubview:Question];

//第一选项。
button = [UIButton buttonWithType:UIButtonTypeCustom];
[button addTarget:self
action:@selector(buttonOne)
forControlEvents:UIControlEventTouchDown];
button.titleLabel.lineBreakMode = UILineBreakModeWordWrap;
button.titleLabel.font = [UIFont systemFontOfSize:24];
[button setTitle:[theQuiz objectAtIndex:row + 1] forState:UIControlStateNormal];
[button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
button.frame = CGRectMake(34,200 + Question.frame.size.height,700,ans1.frame.size.height + 20);
[self.view addSubview:button];
button.layer.borderWidth = 3;
button.layer.borderColor = [[UIColor purpleColor] CGColor];
button.layer.cornerRadius = 10.0;
[button setBackgroundImage:[UIImage imageNamed:@buttun.png] forState:UIControlStateNormal];
button.titleEdgeInsets = UIEdgeInsetsMake(5,5,5,5);

//第二期权。
button2 = [UIButton buttonWithType:UIButtonTypeCustom];
[button2 addTarget:self
action:@selector(buttonTwo)
forControlEvents:UIControlEventTouchDown];
[button2 setTitle:[theQuiz objectAtIndex:row + 2] forState:UIControlStateNormal];
[button2 setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
button2.titleLabel.lineBreakMode = UILineBreakModeWordWrap;
button2.titleLabel.font = [UIFont systemFontOfSize:24];
button2.frame = CGRectMake(34,230 + Question.frame.size.height + button.frame.size.height,700,ans2.frame.size.height + 20);
button2.layer.borderWidth = 3;
button2.layer.borderColor = [[UIColor darkGrayColor] CGColor];
button2.layer.cornerRadius = 10.0;
[self.view addSubview:button2];
[button2 setBackgroundImage:[UIImage imageNamed:@buttun2.png] forState:UIControlStateNormal];
button2.titleEdgeInsets = UIEdgeInsetsMake(5,5,5,5);

//第三种选择。
button3 = [UIButton buttonWithType:UIButtonTypeCustom];
[button3 addTarget:self
action:@selector(buttonThree)
forControlEvents:UIControlEventTouchDown];
[button3 setTitle:[theQuiz objectAtIndex:row + 3] forState:UIControlStateNormal];
[button3 setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
button3.titleLabel.lineBreakMode = UILineBreakModeWordWrap;
button3.titleLabel.font = [UIFont systemFontOfSize:24];
button3.frame = CGRectMake(34,260 + Question.frame.size.height + button.frame.size.height + button2.frame.size.height,700,ans3.frame.size.height + 20) ;
button3.layer.borderWidth = 3;
button3.layer.borderColor = [[UIColor purpleColor] CGColor];
button3.layer.cornerRadius = 10.0;

[self.view addSubview:button3];
[button3 setBackgroundImage:[UIImage imageNamed:@buttun.png] forState:UIControlStateNormal];
button3.titleEdgeInsets = UIEdgeInsetsMake(5,5,5,5);

//第四选项。
button4 = [UIButton buttonWithType:UIButtonTypeCustom];
[button4 addTarget:self
action:@selector(buttonFour)
forControlEvents:UIControlEventTouchDown];
[button4 setTitle:[theQuiz objectAtIndex:row + 4] forState:UIControlStateNormal];
[button4 setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
button4.titleLabel.lineBreakMode = UILineBreakModeWordWrap;
button4.titleLabel.font = [UIFont systemFontOfSize:24];
button4.frame = CGRectMake(34,290 + Question.frame.size.height + button.frame.size.height + button2.frame.size.height + button3.frame.size.height,700,ans4。 frame.size.height + 20);
button4.layer.borderWidth = 3;
button4.layer.borderColor = [[UIColor darkGrayColor] CGColor];
button4.layer.cornerRadius = 10.0;
[self.view addSubview:button4];
[button4 setBackgroundImage:[UIImage imageNamed:@buttun2.png] forState:UIControlStateNormal];
button4.titleEdgeInsets = UIEdgeInsetsMake(5,5,5,5);

NSString * strright = [theQuiz objectAtIndex:row + 7];
NSString * strtext = [[NSString alloc] initWithFormat:@%@,strright];

rightans = [[UILabel alloc] initWithFrame:CGRectMake(50,330,650,150)];
rightans.numberOfLines = 0;
rightans.text = strtext;
rightans.backgroundColor = [UIColor clearColor];
rightans.font = [UIFont systemFontOfSize:26];
[self.view addSubview:rightans];
[rightans sizeToFit];
[rightans setHidden:YES];

//说明。
NSString * des = [theQuiz objectAtIndex:row + 6];
NSString * destext = [[NSString alloc] initWithFormat:@\ n>说明:\ n%@ \ n \ n,des];

描述= [[[UILabel alloc] initWithFrame:CGRectMake(40,400 + rightans.frame.size.height,690,150)] autorelease];
Description.numberOfLines = 0;
// Description.font = [UIFont systemFontOfSize:13.5];
Description.text = destext;
[描述setFont:[UIFont fontWithName:@Futurasize:26]];
Description.lineBreakMode = UILineBreakModeWordWrap;
Description.backgroundColor = [UIColor clearColor];
[描述sizeToFit];
[self.view addSubview:Description];
[描述setHidden:YES];


ContainerView = [[UIView alloc] initWithFrame:CGRectMake(30,400 + rightans.frame.size.height,700,Description.frame.size.height)];
ContainerView.backgroundColor = [UIColor clearColor];
ContainerView.layer.cornerRadius = 10.0;
ContainerView.layer.borderColor = [[UIColor grayColor] CGColor];
ContainerView.layer.borderWidth = 3;
// [ContainerView addSubview:Description];
[self.view addSubview:ContainerView];
[ContainerView setHidden:YES];

//对于挑战文本
NSString * challange = [theQuiz objectAtIndex:row + 8];
setchallange = [[NSString alloc] initWithFormat:@%@,challange]; //这里的内存泄漏
Challengetext.text = setchallange;



//每次挑战的图像
background = [[[UIImageView alloc] initWithFrame:CGRectMake(15.0f,15.0f,130.0f,110.0f) ] autorelease];
[background setImage:[UIImage imageNamed:[theQuiz objectAtIndex:row + 9]]];
[self.view addSubview:background];

在dealloc函数中,我释放了所有标签和按钮以及我创建的其他对象但仍然是内存泄漏得到了这个警告(收到内存警告级别1,有时是2级)


我搜索了我的内存被泄漏的地方,并且它在NSString setchallenge

请帮帮我...

任何帮助将不胜感激..



谢谢。 。

每次调用setchallenge = [[NSString alloc] ....



应该是:

  //对于挑战文本
NSString * challange = [theQuiz objectAtIndex:row + 8];
Challengetext.text = [NSString stringWithFormat:@%@,challange];

stringWithFormat返回一个自动释放的字符串,下次自动释放池耗尽时会释放该字符串。



joe


I am new to iPhone development. I am creating an application in which i need to create buttons and labels programmatically.
So I am doing this in .h file

@interface FirstQuizViewControlleriPad : UIViewController{

IBOutlet UIButton *startgame;
UILabel *theQuestion;
IBOutlet UIScrollView *scrollview;
UILabel *Question;
UILabel *Description;
UIView *ContainerView;
UILabel *Challengetext;
UIImageView *img1;
UIImageView *img2;
UIImageView *background;
IBOutlet UIButton *reviewbtn;
UILabel *ans1;
UILabel *ans2;
UILabel *ans3;
UILabel *ans4;

UIButton *button;
UIButton *button2;
UIButton *button3;
UIButton *button4;
UILabel *rightans;
UILabel *theScore;
UIButton *nextbtn;
UIButton *backbtn;
NSString *setchallange;

AVAudioPlayer *AVback;
AVAudioPlayer *AVstart;
NSArray *theQuiz;
NSInteger questionNumber;
NSInteger rightAnswer;
NSInteger myScore;
NSInteger finalScoreipad1;
BOOL restartGame;
id QuestionReview;

}

@property (retain , nonatomic) IBOutlet UIButton *startgame;
@property (retain , nonatomic) NSArray *theQuiz;
@property (retain , nonatomic) IBOutlet UILabel *theScore;
@property (retain , nonatomic) IBOutlet UIButton *nextbtn;
@property (retain , nonatomic) IBOutlet UIScrollView *scrollview;
@property (retain , nonatomic) IBOutlet UIButton *backbtn;
@property (retain , nonatomic) IBOutlet UILabel *Challengetext;
@property (retain , nonatomic) IBOutlet UIImageView *img1;
@property (retain , nonatomic) IBOutlet UIImageView *img2;
@property (retain , nonatomic) id QuestionReview;
@property (retain , nonatomic) IBOutlet UIButton *reviewbtn;
@property (retain ,nonatomic) IBOutlet UIButton *button;
@property (retain ,nonatomic) IBOutlet UIButton *button2;
@property (retain ,nonatomic) IBOutlet UIButton *button3;
@property (retain ,nonatomic) IBOutlet UIButton *button4;
@property (retain ,nonatomic) IBOutlet UILabel *ans1;
@property (retain ,nonatomic) IBOutlet UILabel *ans2;
@property (retain ,nonatomic) IBOutlet UILabel *ans3;
@property (retain ,nonatomic) IBOutlet UILabel *ans4;
@property (retain , nonatomic) IBOutlet UILabel *Question;
@property (retain , nonatomic) NSString *setchallange;

-(void)askQuestion;

in .m file

questionNumber = questionNumber + 1;
NSInteger row = 0;
if(questionNumber == 1)
{
    row = questionNumber - 1;
}
else
{
    row = ((questionNumber - 1) * 10);
}

NSString *selected = [theQuiz objectAtIndex:row];
NSString *activeQuestion = [[NSString alloc] initWithFormat:@"%@", selected];
QuestionReview = activeQuestion;

//lbl ref to btn1
ans1 = [[[UILabel alloc] initWithFrame:CGRectMake(36, 292, 697, 100)] autorelease];
ans1.numberOfLines = 0;
ans1.font = [UIFont systemFontOfSize:26];
ans1.text = [theQuiz objectAtIndex:row+1];
ans1.lineBreakMode = UILineBreakModeWordWrap;
[ans1 sizeToFit];
[self.view addSubview:ans1];
//lbl ref to btn2
ans2 = [[[UILabel alloc] initWithFrame:CGRectMake(36, 312 + ans1.frame.size.height , 697, 100)] autorelease];
ans2.numberOfLines = 0;
ans2.font = [UIFont systemFontOfSize:26];
ans2.text = [theQuiz objectAtIndex:row+2];
ans2.lineBreakMode = UILineBreakModeWordWrap;
[ans2 sizeToFit];
[self.view addSubview:ans2];
//lbl ref to btn3
ans3 = [[[UILabel alloc] initWithFrame:CGRectMake(36 ,332 + ans1.frame.size.height + ans2.frame.size.height , 697 , 100)] autorelease];
ans3.numberOfLines = 0;
ans3.font = [UIFont systemFontOfSize:26];
ans3.text = [theQuiz objectAtIndex:row+3] ;
ans3.lineBreakMode = UILineBreakModeWordWrap;
[ans3 sizeToFit];
[self.view addSubview:ans3];
//lbl ref to btn4
ans4 = [[[UILabel alloc] initWithFrame:CGRectMake(36, 352 + ans1.frame.size.height + ans2.frame.size.height + ans3.frame.size.height, 697, 100)] autorelease];
ans4.numberOfLines = 0;
ans4.font = [UIFont systemFontOfSize:26];
ans4.text = [theQuiz objectAtIndex:row+4];
ans4.lineBreakMode = UILineBreakModeWordWrap;
[ans4 sizeToFit];
[self.view addSubview:ans4];

rightAnswer = [[theQuiz objectAtIndex:row+5] intValue];

Question = [[[UILabel alloc] initWithFrame:CGRectMake(22, 130, 725, 160)] autorelease];
Question.numberOfLines = 0;
//Question.font = [UIFont systemFontOfSize:27];
Question.text = activeQuestion;
Question.lineBreakMode = UILineBreakModeWordWrap;
[Question setFont:[UIFont fontWithName:@"Futura" size:26]];
Question.backgroundColor = [UIColor clearColor];
[Question sizeToFit];
[self.view addSubview:Question];

//For 1st Option.
button = [UIButton buttonWithType:UIButtonTypeCustom];
[button addTarget:self 
           action:@selector(buttonOne)
 forControlEvents:UIControlEventTouchDown];
button.titleLabel.lineBreakMode = UILineBreakModeWordWrap;
button.titleLabel.font = [UIFont systemFontOfSize:24];
[button setTitle:[theQuiz objectAtIndex:row+1] forState:UIControlStateNormal];
[button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
button.frame = CGRectMake(34, 200 + Question.frame.size.height , 700, ans1.frame.size.height + 20);
[self.view addSubview:button];
button.layer.borderWidth = 3;
button.layer.borderColor = [[UIColor purpleColor ] CGColor];
button.layer.cornerRadius = 10.0;
[button setBackgroundImage:[UIImage imageNamed:@"buttun.png"] forState:UIControlStateNormal];
button.titleEdgeInsets = UIEdgeInsetsMake(5, 5, 5, 5);

//For 2nd Option.
button2 = [UIButton buttonWithType:UIButtonTypeCustom];
[button2 addTarget:self 
            action:@selector(buttonTwo)
  forControlEvents:UIControlEventTouchDown];
[button2 setTitle:[theQuiz objectAtIndex:row+2] forState:UIControlStateNormal];
[button2 setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
button2.titleLabel.lineBreakMode = UILineBreakModeWordWrap;
button2.titleLabel.font = [UIFont systemFontOfSize:24];
button2.frame = CGRectMake(34, 230 + Question.frame.size.height + button.frame.size.height , 700, ans2.frame.size.height + 20);
button2.layer.borderWidth = 3;
button2.layer.borderColor = [[UIColor darkGrayColor ] CGColor];
button2.layer.cornerRadius = 10.0;
[self.view addSubview:button2];
[button2 setBackgroundImage:[UIImage imageNamed:@"buttun2.png"] forState:UIControlStateNormal];
button2.titleEdgeInsets = UIEdgeInsetsMake(5, 5, 5, 5);

//For 3rd Option.
button3 = [UIButton buttonWithType:UIButtonTypeCustom];
[button3 addTarget:self 
            action:@selector(buttonThree)
  forControlEvents:UIControlEventTouchDown];
[button3 setTitle:[theQuiz objectAtIndex:row+3] forState:UIControlStateNormal];
[button3 setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
button3.titleLabel.lineBreakMode = UILineBreakModeWordWrap;
button3.titleLabel.font = [UIFont systemFontOfSize:24];
button3.frame = CGRectMake(34, 260 + Question.frame.size.height + button.frame.size.height + button2.frame.size.height , 700, ans3.frame.size.height + 20);
button3.layer.borderWidth = 3;
button3.layer.borderColor = [[UIColor purpleColor ] CGColor];
button3.layer.cornerRadius = 10.0;

[self.view addSubview:button3];
[button3 setBackgroundImage:[UIImage imageNamed:@"buttun.png"] forState:UIControlStateNormal];
button3.titleEdgeInsets = UIEdgeInsetsMake(5, 5, 5, 5);

//For 4th Option.
button4 = [UIButton buttonWithType:UIButtonTypeCustom];
[button4 addTarget:self 
            action:@selector(buttonFour)
  forControlEvents:UIControlEventTouchDown];
[button4 setTitle:[theQuiz objectAtIndex:row+4] forState:UIControlStateNormal];
[button4 setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
button4.titleLabel.lineBreakMode = UILineBreakModeWordWrap;
button4.titleLabel.font = [UIFont systemFontOfSize:24];
button4.frame = CGRectMake(34, 290 + Question.frame.size.height + button.frame.size.height + button2.frame.size.height + button3.frame.size.height , 700, ans4.frame.size.height + 20);
button4.layer.borderWidth = 3;
button4.layer.borderColor = [[UIColor darkGrayColor ] CGColor];
button4.layer.cornerRadius = 10.0;
[self.view addSubview:button4];
[button4 setBackgroundImage:[UIImage imageNamed:@"buttun2.png"] forState:UIControlStateNormal];
button4.titleEdgeInsets = UIEdgeInsetsMake(5, 5, 5, 5);

NSString *strright = [theQuiz objectAtIndex:row+7];
NSString *strtext = [[NSString alloc] initWithFormat:@"%@" , strright];

rightans = [[UILabel alloc] initWithFrame:CGRectMake(50, 330, 650, 150)];
rightans.numberOfLines = 0;
rightans.text = strtext;
rightans.backgroundColor = [UIColor clearColor];
rightans.font = [UIFont systemFontOfSize:26];
[self.view addSubview:rightans];
[rightans sizeToFit];
[rightans setHidden:YES];

//Description.
NSString *des = [theQuiz objectAtIndex:row+6];
NSString *destext = [[NSString alloc] initWithFormat:@"\n> Explanation :\n%@\n\n" , des];

Description = [[[UILabel alloc] initWithFrame:CGRectMake(40, 400 + rightans.frame.size.height , 690, 150)] autorelease];
Description.numberOfLines = 0;
// Description.font = [UIFont systemFontOfSize:13.5];
Description.text = destext;
[Description setFont:[UIFont fontWithName:@"Futura" size:26]];
Description.lineBreakMode = UILineBreakModeWordWrap;
Description.backgroundColor = [UIColor clearColor];
[Description sizeToFit];
[self.view addSubview:Description];
[Description setHidden:YES];


ContainerView = [[UIView alloc] initWithFrame:CGRectMake(30, 400 + rightans.frame.size.height , 700 ,Description.frame.size.height)];
ContainerView.backgroundColor = [UIColor clearColor];
ContainerView.layer.cornerRadius = 10.0;
ContainerView.layer.borderColor = [[UIColor grayColor] CGColor];
ContainerView.layer.borderWidth = 3;
// [ContainerView addSubview:Description];
[self.view addSubview:ContainerView];
[ContainerView setHidden:YES];

//For Challenge Text
NSString *challange = [theQuiz objectAtIndex:row+8];
  setchallange = [[NSString alloc] initWithFormat:@"%@" , challange];//Memory leak here
 Challengetext.text = setchallange;



//Image For Every Challenge
background = [[[UIImageView alloc] initWithFrame:CGRectMake(15.0f, 15.0f, 130.0f, 110.0f)] autorelease];
[background setImage:[UIImage imageNamed:[theQuiz objectAtIndex: row + 9]]];
[self.view addSubview:background];

In dealloc function , I release all the labels and buttons and other objects that i have created but still i got this warning for memory leakage (received memory warning level 1 and some times level 2)
I searched where my memory is being leaked and it is leak at NSString setchallenge

Please help me out this..
Any help will be appreciated..

Thanks..

解决方案

You're creating a new string with every call to setchallenge = [[NSString alloc]....

Should be:

//For Challenge Text
NSString *challange = [theQuiz objectAtIndex:row+8];
Challengetext.text = [NSString stringWithFormat:@"%@" , challange];

stringWithFormat returns an auto-released string, which will get deallocated next time the auto-release pool is drained.

joe

这篇关于收到内存警告。 1级的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆