出于某种原因,我的 NSMutableArray 总是空的,你们能帮帮我吗?这是代码:
-(NSMutableArray*) parseIt: (NSString*) toPars {
NSMutableArray *waranties;
NSString *beginTitle = @"<title>";
NSString *eindTitle = @"</title>";
NSString *title = [self getTitle:toPars start:beginTitle and:eindTitle];
if(title != NULL){
NSLog(@"de title = %@", title);
[waranties addObject:title];
NSLog(@"de title = %@", [waranties objectAtIndex:0]);
}
第一个 nslog 完美地显示了必须显示的内容,第二个显示为空;提前致谢