Note that there are some explanatory texts on larger screens.

plurals
  1. POTableView in iOS 5 Crashed with ARC enabled
    text
    copied!<p>I have this problem with a tableview in iOS5 that is giving me errors, note that it works well with the older sdk. This is the relevant code: h file #import </p> <pre><code>@interface WordListTableViewController : UITableViewController { //NSMutableDictionary *words; //NSArray *sections; } @end </code></pre> <p>m file #import "WordListTableViewController.h" #import "DefinitionViewController.h"</p> <pre><code>@interface WordListTableViewController() @property (nonatomic, strong) NSMutableDictionary *words; @property (nonatomic, strong) NSArray *sections; @end @implementation WordListTableViewController @synthesize words, sections; - (NSMutableDictionary *) words { if(!words){ NSURL *wordsURL = [NSURL URLWithString:@"http://localhost/Vocabulous.txt"]; words = [NSMutableDictionary dictionaryWithContentsOfURL:wordsURL] ; } return words; } - (NSArray *) sections { if(!sections) { sections = [[self.words allKeys] sortedArrayUsingSelector:@selector(compare:)] ; } return sections; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"WordListTableViewCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; } //cell.textLabel.text = cell.textLabel.text = [self wordAtIndexPath:indexPath]; cell.textLabel.text = @"Test"; return cell; } </code></pre> <p>h File for App Delegate #import </p> <pre><code>@interface VocabAppDelegate : UIResponder &lt;UIApplicationDelegate&gt; { } @property (strong, nonatomic) UIWindow *window; @property (strong, nonatomic) UINavigationController *nav; @end </code></pre> <p>m File for App Delegate with relevant code : #import "VocabAppDelegate.h" #import "WordListTableViewController.h"</p> <pre><code>@implementation VocabAppDelegate @synthesize window; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. WordListTableViewController *wltvc = [[WordListTableViewController alloc] init]; self.nav = [[UINavigationController alloc] initWithRootViewController: wltvc ]; self.window.rootViewController = self.nav; [self.window makeKeyAndVisible]; return YES; } </code></pre> <p>The Error is the following: EXEC_BAD_ACCESS It's like it only sets the visible cells and when I start scrolling down looking for the not visible ones, it's like they can't be displayed.</p> <p>Fina UPDATE : Following the advise from mattyhoe, I've replaced the method wordAtIndexPath with a static text, and followed the other two side notes Plus the way I use the delegate and it works !!!</p> <p>Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload