0
내가 아이폰 앱의 로그인 코드를 작성 엑스 코드를 사용하고 있는데 내 코드구문 분석 XML 파일 (엑스 코드)
- (void)viewDidUnload
{
[super viewDidUnload];
users =[[NSMutableArray alloc] init];
NSString *path = [[NSBundle mainBundle] pathForResource: @"login" ofType:@"xml" inDirectory:(@"Users/roaalturki/Desktop")];
NSURL *xmlurl = [NSURL fileURLWithPath:path];
xmlparsser=[[NSXMLParser alloc] initWithContentsOfURL:xmlurl];
[xmlparsser setDelegate:self];
[xmlparsser parse];
}
-(void) parser: (NSXMLParser *) parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict
{
currentelement=[elementName copy];
if ([elementName isEqualToString:@"username"]) {
item =[[NSMutableDictionary alloc]init];
currentuser =[[NSMutableString alloc]init];
currentpassword=[[NSMutableString alloc]init];
}
}
오류 메시지는? - 파일을 열지 않으셨습니까? 그것을 분석하지 못했습니다? 우리에게 여기에 가야 할 것이 많지 않습니다. – DRVic
앱 번들에서 "Users/roaalturki/Desktop/login.xml"경로를 사용할 수 있습니까? – Sven