title: Q:Get rows count by indexPath of tableView comes `Trying to put the stack in unreadable memory at:` error
body: <p>In my tableView delegate methods:</p>
  
  <p>I get <code>numberOfRows</code> and <code>numberOfSections</code> in my <code>tableView</code> <code>delegate</code> methods:</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  </code></pre>
  
  <p>and</p>
  
  <pre><code>- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath  ,
  </code></pre>
  
  <p>but in the <code>- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section</code> method, I tried this method:</p>
  
  <pre><code>NSString *key = [NSString stringWithFormat:@"%ld", section];
  </code></pre>
  
  <p>In this line , it shows the error:Thread 1：EXC_BAD_ACCESS(code=2,address=0x)
  and I taken the <code>(lldb)</code>:</p>
  
  <pre><code>(lldb) po [NSString stringWithFormat:@"%ld", section]
  error: Trying to put the stack in unreadable memory at: 0x7fff50739eb0.
  </code></pre>
  
  <p>If I don't get <code>numberOfRows</code> and <code>numberOfSections</code> in my <code>tableView</code> <code>delegate</code> methods:
    &nbsp;&nbsp;&nbsp; the error will not appear.</p>
  
  <p>The below is my code:</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  
      static NSString *CellIdentifier = @"Cell";
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  
      if (cell == nil) {
          cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
      }
  
      NSInteger numberOfRows = [tableView numberOfRowsInSection:[indexPath section]];
  
      NSInteger numberOfSections = [tableView numberOfSections];
  
      if (indexPath.row == 0 &amp;&amp; numberOfRows != 1) {
  
          cell.textLabel.text = [_arr objectAtIndex:indexPath.row];
      }
  
  
  
      return cell;
  }
  
      - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  
          NSInteger numberOfRows = [tableView numberOfRowsInSection:[indexPath section]];
  
          NSInteger numberOfSections = [tableView numberOfSections];
  
          if (indexPath.row == 0 &amp;&amp; numberOfRows != 1) {
  
               return 40;
          }else {
              return 5;
          }
  
      }
  
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  
      //NSString *key = [NSString stringWithFormat:@"%d", (int)section];
  
      NSString *key = [NSString stringWithFormat:@"%ld", section];  // this line shows the error.
  
  
      BOOL folded = [[_foldInfoDic objectForKey:key] boolValue];
  
      if (section == 0) {
          return folded?_arr.count:1;
      } else if (section == 1) {
          return folded?_arr.count:1;
      } else if (section == 2) {
          return folded?_arr.count:1;
      } else {
          return folded?_arr.count:0;
      }
  }
  </code></pre>