查看加载的代码中有什么错误,导致程序崩溃?
我正在使用此代码来查看确实加载了..
- (void)viewDidLoad {
myPicker.hidden=TRUE;
NSArray * shopping=[NSArray arrayWithObjects:@"Lie in bed",
@"Shower",
@"Brush Teeth",
@"Eat",
@"Make Lunch",
@"Dressed",
@"Make up",
@"Hair",
@"Prepare Childern",
@"Other",nil];
for(int i=0;i<61;i++)
{
if (array_time ==nil) {
array_time=[[NSMutableArray alloc] init];
}
NSString *str=[NSString stringWithFormat:@"%i Min",i];
[array_time addObject:[NSString stringWithFormat:@"%@",str]];
[str release];
}
for (int i=0; i<61; i++) {
NSLog(@"%@",[array_time objectAtIndex:i]);
}
if(array_from==nil)
{
array_from=[[NSMutableArray alloc] init];
}
[array_from addObject:shopping];
[super viewDidLoad];
}
之后我为表视图进行了编码。我已经通过应用断点进行了检查,但在视图加载后我被终止了。在控制台上它没有给出任何错误。 那么这段代码或任何地方有什么错误呢?
提前致谢..
I am using this code for view did load..
- (void)viewDidLoad {
myPicker.hidden=TRUE;
NSArray * shopping=[NSArray arrayWithObjects:@"Lie in bed",
@"Shower",
@"Brush Teeth",
@"Eat",
@"Make Lunch",
@"Dressed",
@"Make up",
@"Hair",
@"Prepare Childern",
@"Other",nil];
for(int i=0;i<61;i++)
{
if (array_time ==nil) {
array_time=[[NSMutableArray alloc] init];
}
NSString *str=[NSString stringWithFormat:@"%i Min",i];
[array_time addObject:[NSString stringWithFormat:@"%@",str]];
[str release];
}
for (int i=0; i<61; i++) {
NSLog(@"%@",[array_time objectAtIndex:i]);
}
if(array_from==nil)
{
array_from=[[NSMutableArray alloc] init];
}
[array_from addObject:shopping];
[super viewDidLoad];
}
after that i have coded for table view. I have checked by applying break point all over but i was terminate after view did load. On console it is not giving any error.
So what is mistake in this code or any where?
Thanks in advance..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你真的不需要释放这个字符串:
str
你没有分配它
you don't really need to release this string:
str
you didn't allocate it