2012-02-29 2 views
0

안녕하세요, 아래에 표시된 코드를 구현했습니다. NSMutableArray 항목이 아래와 같이 표시되지만 배열 항목을 테이블보기에 업로드 할 때 부트 스트랩 서버에 ContactTesting이 표시됩니다. 오류 : 알 수없는 오류 코드. 이것은 일반적으로이 프로세스의 다른 인스턴스가 이미 실행 중이거나 디버거 (gdb)에 정지되어 있음을 의미합니다. 그래서 아이폰에 tableview에 상향 NSMutableArray 항목에 대한 솔루션을 제공합니다. 그 아래에 등록 할 수 없습니다 NSMutableArray 데이터 항목을 테이블 뷰로 업로딩하는 방법은 무엇입니까?

를 나타내는 도시 한 바와 같이 전있는 tableView 코드 구현이 대
array=[[NSMutableArray alloc]init]; 
for (int i=0; i<[arrStation count]; i++){ 
     NSString *str=[[[[[arrStation objectAtIndex:i] objectForKey:@"content"] objectForKey:@"m:properties"] objectForKey:@"d:ContactName"] objectForKey:@"text"]; 
     // NSlog(@"name is : %@",str); 
     //NSLog(@"name is->>>>>>> : %@",str); 
     [array addObject:str]; 
     NSLog(@"name is->>>>>>> : %@",array); 

} 


2012-02-29 14:24:20.256 ContactTesting[564:f803] name is->>>>>>> : (
    "\n  Enrico Gaetani", 
    "\n  J\U00e9r\U00f4me Tredan", 
    "\n  Mike Tsalidis", 
    "\n  Dana Sugarman", 
    "\n  Necip Ozyucel", 
    "\n  Goksel Topbas", 
    "\n  Nizar Abdul-Baki", 
    "\n  Johannes Kanis", 
    "\n  Kara Westhusing", 
    "\n  Andreas Erlacher", 
    "\n  Rudy Van Hoe", 
    "\n  Lars Nygaard", 
    "\n  Juha Karppinen", 
    "\n  Ronan Geraghty", 
    "\n  Luca Venturelli", 

부트 스트랩 서버 com.fitzgerald.는-ContactTesting.ContactTesting. 오류 : 알 수없는 오류 코드. . 이것은 일반적으로이 공정의 또 다른 인스턴스가 이미 실행 된 또는 디버거에 걸려 있는지 수단 (GDB)

  • {

    myTableView.delegate = 자기의 viewDidLoad (보이드); myTableView.dataSource = self; myTableView.separatorStyle = UITableViewCellSeparatorStyleNone;

    myTableView.backgroundColor = [[UIColor alloc] initWithPatternImage : [UIImage imageNamed : @ "list.png"]]]; myTableView.scrollEnabled = YES; array = [NSMutableArray alloc];

    [super viewDidLoad];

    [자체 테스트]; // 일반적으로 펜촉에서 뷰를로드 한 후 추가 설정을 수행하십시오. }

  • (NSInteger) numberOfSectionsInTableView : (UITableView *) tableView { return 1;

  • }
  • (NSInteger)를 tableView (jQuery과 *) 표 numberOfRowsInSection (NSInteger) 섹션 { 창 [어레이 카운트]; }

- (있는 UITableViewCell *)있는 tableView : (jQuery과 *)있는 tableView cellForRowAtIndexPath : (NSIndexPath *) indexPath {

static NSString *CellIdentifier = @"Cell"; 
//here you check for PreCreated cell. 
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 
if (cell == nil) { 
    cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; 
} 

//Fill the cells... 
cell.textLabel.text = [array objectAtIndex: indexPath.row]; 
//yourMutableArray is Array 
return cell; 

}

- (무효) { 테스트 // NSLog (@ ">>>>>>>>>>>> 233333");

NSString *jobSearchUrlString = [NSString stringWithFormat:@"http://infra2appsmobile.cloudapp.net/Infra2Apps.svc/Contacts"]; 
//NSLog(@"url for new articles is = %@",jobSearchUrlString); 
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:jobSearchUrlString]]; 

NSURLConnection *theconnection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; 
if (theconnection) { 
    RoutData = [[NSMutableData alloc] init]; 
} 

}

- (무효) 연결 (있는 NSURLConnection *) 연결 didReceiveResponse (NSURLResponse *) 응답 {

[RoutData setLength: 0]; 

} - (무효) 연결 (있는 NSURLConnection *) 연결 didReceiveData : (NSData *) 데이터 { [RoutData appendData : data]; < < < ---- % @ {// NSLog (@ "--- >>> ContactNameis

NSString *thexml = [[NSString alloc] initWithData:RoutData encoding:NSUTF8StringEncoding]; 

NSDictionary *dictXML= [XMLReader dictionaryForXMLString:thexml error:nil]; 

NSMutableArray *arrStation = [[dictXML objectForKey:@"feed"] objectForKey:@"entry"] ;//this would return the array of station dictionaries 

는 // 위해 (; 나는 < [arrStation 카운트] 난 ++ I = 0 INT) objectForKey : @ "m : properties"] objectForKey : @ "d : ContactName"] objectForKey : @ "text"]);

array=[[NSMutableArray alloc]init]; 
    for (int i=0; i<[arrStation count]; i++){ 
     NSString *str=[[[[[arrStation objectAtIndex:i] objectForKey:@"content"] objectForKey:@"m:properties"] objectForKey:@"d:ContactName"] objectForKey:@"text"]; 
     // NSlog(@"name is : %@",str); 
     //NSLog(@"name is->>>>>>> : %@",str); 
     [array addObject:str]; 
     NSLog(@"name is->>>>>>> : %@",array); 

       } 

답변

관련 문제