0

我已经构建了一个 XML Parse 应用程序,它从 PHP(XML 内容)文件中检索我的数据库中的一些值,在其中一个值中我有一个 URL,问题是,每次我尝试使用这个 URL 加载 webView没有任何反应!我有以下代码:

-(void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName {

    if ( [elementName isEqualToString:@"users"] ) {

        [messages addObject:[NSDictionary dictionaryWithObjectsAndKeys:msgIDEN,@"id",msgAdded,@"added",msgUsername,@"username",msgEmail,@"email",msgMainCode,@"maincode",msgPictureAddress,@"userpictureaddress",nil]];

        [[messages reverseObjectEnumerator] allObjects];

        lastId = msgId;

        [msgAdded release];
        [msgUsername release];
        [msgEmail release];
        [msgMainCode release];
        [msgPictureAddress release];

        NSLog(@"UserData:Success");
        NSString *urlAddress = msgPictureAddress;
        NSURL *url = [NSURL URLWithString:urlAddress];
        NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
        [webViewMateus loadRequest:requestObj];


    }

    if ( [elementName isEqualToString:@"id"] )                  { inIDEN = NO;  }
    if ( [elementName isEqualToString:@"username"] )            { inUsername = NO;  }
    if ( [elementName isEqualToString:@"email"] )               { inEmail = NO;  }
    if ( [elementName isEqualToString:@"usermaincode"] )        { inMainCode = NO;  }
    if ( [elementName isEqualToString:@"userpictureaddress"] )  { inPictureAddress = NO;  }

}

如何使 UIWebView 地址与我的相同NSMutableString = userpictureaddress

4

1 回答 1

0

如果您查看您的代码,您只是在将 msgPictureAddress 分配给 urlAddress 之前丢弃(发布)了它。你确定要在那个时候发布那些东西吗?

于 2012-05-13T20:44:54.840 回答