Note that there are some explanatory texts on larger screens.

plurals
  1. POTrouble with reloading data into NSArray (maybe because of ARC)
    primarykey
    data
    text
    <p>I have the following method called when my UITableView reloads:</p> <pre><code>-(NSArray *)theAccounts { if (__theAccounts != nil) { return __theAccounts; } // Create an account store object. ACAccountStore *accountStore = [[ACAccountStore alloc] init]; // Create an account type that ensures Twitter accounts are retrieved. ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter]; // Request access from the user to use their Twitter accounts. [accountStore requestAccessToAccountsWithType:accountType withCompletionHandler:^(BOOL granted, NSError *error) { if(granted) { // Get the list of Twitter accounts. NSArray *accountsArray = [[NSArray alloc] initWithArray:[accountStore accountsWithAccountType:accountType]]; self.theAccounts = accountsArray; } }]; return __theAccounts; } </code></pre> <p>Setter Methods in .h:</p> <pre><code>@property (strong, nonatomic) NSArray *theAccounts; </code></pre> <p>and in the .m:</p> <pre><code>@synthesize theAccounts = __theAccounts; </code></pre> <p>I would like to be able to effectively empty self.theAccounts and reload. So I created a resync method, but it never returns any values after I reload the table:</p> <pre><code>-(void)resyncAccounts { self.theAccounts = nil; [self.tableView reloadData]; } </code></pre> <p>I am using ARC on iOS 5 SDK. Could this be an issue? I've done similar before with fetchedResultsController and had no issues, but that was not ARC. Worth noting that it does return data the first time it is called, and returns __TheAccounts after that, until I try to -(void)resyncAccounts{}.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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