title: Why I can't put [a objectAtIndex:indexPath.row] at NSString
body: <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  NSString *selectedFriend = [friends objectAtIndex:indexPath.row];
  //selectedFriend invalid summary
  //Initialize the detail view controller and display it.
  LeaveMViewController *LMController = [[LeaveMViewController alloc] initWithNibName:nil bundle:[NSBundle mainBundle]];
  LMController.whosmess = selectedFriend;
  [LMController release];
  LMController = nil;
  </code></pre>
  
  <p>please help</p>
  
  <pre><code>NSMutableArray *friends;
  NSMutableDictionary *listofFriends;
  
  
   - (void) parseXMLFileAtURL:(NSString *) URL{   
  friends = [[NSMutableArray alloc] init];
  
  NSURL *xmlURL = [NSURL URLWithString:URL];  
  friendsParser = [[NSXMLParser alloc] initWithContentsOfURL:xmlURL];
  [friendsParser setDelegate:self];
  [friendsParser setShouldProcessNamespaces:NO];
  [friendsParser setShouldReportNamespacePrefixes:NO];
  [friendsParser setShouldResolveExternalEntities:NO];
  
  [friendsParser parse];
  
  }
  
  - (void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)parseError {
  NSString * errorString = [NSString stringWithFormat:@"Unable to download story feed        from web site (Error code %i )", [parseError code]];
  NSLog(@"error parsing XML: %@", errorString);
  
  UIAlertView * errorAlert = [[UIAlertView alloc] initWithTitle:@"Error loading content" message:errorString delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
  [errorAlert show];
     }
  
  - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName   namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict{          
  if ([elementName isEqualToString:@"Friend"]){
      listOfFriends = [[NSMutableDictionary alloc] init];
      [listOfFriends setObject:[attributeDict objectForKey:@"firstname"] forKey:@"firstname"];
      [listOfFriends setObject:[attributeDict objectForKey:@"user_id"] forKey:@"user_id"];        
      [friends addObject:[listOfFriends copy]];   
  }
  
      }
      - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  
  static NSString *MyIdentifier = @"MyIdentifier";
  
  UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
  if (cell == nil) {
      cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:MyIdentifier] autorelease];
  }
  
  // Set up the cell
  int storyIndex = [indexPath indexAtPosition: [indexPath length] - 1];
  [cell setText:[NSString stringWithFormat:@"%@, %@",[[friends objectAtIndex: storyIndex] objectForKey: @"firstname"],[[friends objectAtIndex: storyIndex] objectForKey: @"user_id"]]];
  return cell;
      }
  
     - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  NSString *selectedFriend = @"hui";
  who=[[NSString alloc] initWithFormat:@"ai bliat %&amp;",[friends objectAtIndex:indexPath.row]];
  // NSString *selectedFriend = [friends objectAtIndex:indexPath.row];
  LeaveMViewController *LMController = [[LeaveMViewController alloc] initWithNibName:nil bundle:[NSBundle mainBundle]];
  LMController.whosmess = selectedFriend;
  [LMController release];
  LMController = nil;
  
  }
  </code></pre>