相关疑难解决方法(0)

如何在标签栏中设置徽章值?

我必须从xml读取数据,并且必须在视图控制器中显示值.我正在使用tab barcontroller.我必须阅读xml数据,并在标签栏中显示为徽章.这是我的控制器代码.

-(void) parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict
{

    if([elementName isEqualToString:@"Event"]) {
        //Initialize the array.
        rssOutputData  = [[NSMutableArray alloc] init];
        mycount = [attributeDict objectForKey:@"count"];
         NSLog(@"Reading count value :%@",mycount);
    }
    else if([elementName isEqualToString:@"eventdashboard"]) {
        //Initialize the book.
        aEvent = [[Eventlist alloc] init];
        //Extract the attribute here.
        aEvent.id = [[attributeDict objectForKey:@"userid"] integerValue];
        NSLog(@"Reading id value :%d", aEvent.id);
    }
    NSLog(@"Processing Element: %@", elementName);
}
- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string {
    if(!nodecontent)
        nodecontent = [[NSMutableString alloc] initWithString:string];else
            [nodecontent appendString:string]; …
Run Code Online (Sandbox Code Playgroud)

xml objective-c uitabbar ios

29
推荐指数
3
解决办法
4万
查看次数

标签 统计

ios ×1

objective-c ×1

uitabbar ×1

xml ×1