解决方案 »
- address doesn't contain a section that points to a section in a object file
- 关于VNC远程桌面共享
- 关于版本更新的问题,呼叫大侠
- ios7下使用presentViewController会出现ViewController遮挡住状态栏的问题
- -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
- Phonegap in ios
- Objective-C 才开始学习有个问题一直不解,请大神指教
- ios中如何替换uiwebview中的视屏播放器
- 谁用HealthKit做过东西,有没有大神有oc版本的例子借鉴一下 ,跪谢
- 关于arc下内存释放问题
- XCode6 MainStoryboard 中 storyboardWithName:bundle:
- Xcode6.0.1下为何没有了“Empty Application”选项
//返回时将isQuestion置为NO进行解析
isQuestion = NO;
//将状态设置为非跳转
isSugue = NO;
//取当前rootArray中最后一个id进行解析
[self startParseType:[_rootArray lastObject]];
[_rootArray removeLastObject];
[_chapterList removeAllObjects];
[_chapterList addObjectsFromArray:[myPlayer typeDataArray]];
_lineHigh = 44;
_lines = _chapterList.count;
[self.tableview reloadData];
if (_rootArray.count == 0) {
self.backOutlet.enabled = NO;
}
这是返回按钮的代码,每次点击返回都是刷新当前页面的tableview 部分的数据源
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
//选中后的反显颜色即刻消失
//[tableView deselectRowAtIndexPath:indexPath animated:NO];
NSUInteger row = [indexPath row];
if (isSugue == NO)
{
if (self.backOutlet.enabled == NO) {
self.backOutlet.enabled = YES;
}
//防止多次点击以及同父节点的情况,判断当前root是否已经添加,如添加了则不放入rootArray数组中
NSString *rootName =[[_chapterList objectAtIndex:row] objectForKey:@"type_parent"];
if (![[_rootArray lastObject] isEqualToString:rootName])
{
[_rootArray addObject:rootName];
}
if ([[[_chapterList objectAtIndex:row] objectForKey:@"type_isBigPkg"] isEqualToString:@"True"])
{
[self startParseType:[[_chapterList objectAtIndex:row] objectForKey:@"id"]];
[_chapterList removeAllObjects];
[_chapterList addObjectsFromArray:[myPlayer typeDataArray]];
_lineHigh = 44;
_lines = _chapterList.count;
//将章节列表标志设为YES,方便搜索时返回判定
isTypeList = YES;
[self.tableview reloadData];
}
}选中部分的代码,每次选中或返回内存都会增长
菜单栏-Product-Analyze
[self startParseType:[_rootArray lastObject]];
[_rootArray removeLastObject];
[_chapterList removeAllObjects];
[_chapterList addObjectsFromArray:[myPlayer typeDataArray]];
应该是这四句代码的缘故
myPlayer和它的typeDataArray
还有这个方法的实现:startParseType
{
NSMutableString *url = [[NSMutableString alloc]initWithString:@"http:XXXXXX"];
[url appendString:parentId];
[myPlayer StartParse:url isWebXmlLink:YES];
}myPlayer和它的typeDataArray在下面:
//xml文件解析部分
- (void)parserDidStartDocument:(NSXMLParser *)parser
{
@autoreleasepool {
_disBqArray = [[NSMutableArray alloc] init];
_dataArray = [[NSMutableArray alloc] init];
_dict = [[NSMutableDictionary alloc] init];
_dataTmp = [[NSMutableString alloc] init];
_actionArray =[[NSMutableArray alloc ]init];
_titleName = [[NSMutableString alloc] init];
_color = [[NSMutableString alloc] init];
_thick = [[NSMutableString alloc] init];
_clean = [[NSMutableArray alloc] init];
_rubber = [[NSMutableArray alloc] init];
_imagePages = 0;
stepTimes = 0;
//type地址部分的xml数据解析
_typeDataTmp = [[NSMutableString alloc] init];
_typeDict = [[NSMutableDictionary alloc] init];
_typeDataArray = [[NSMutableArray alloc] init]; //question地址部分的xml数据
_questionDataTmp = [[NSMutableString alloc] init];
_questionDict = [[NSMutableDictionary alloc] init];
_questionDataArray = [[NSMutableArray alloc] init];
}
}_rootArray的话也是点返回就把最后一个删除掉了,点cell 加入NSinteger数据