Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6858595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:10:44+00:00 2026-05-27T02:10:44+00:00

I have the following method called when my UITableView reloads: -(NSArray *)theAccounts { if

  • 0

I have the following method called when my UITableView reloads:

-(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;        

}

Setter Methods in .h:

@property (strong, nonatomic) NSArray *theAccounts;

and in the .m:

@synthesize theAccounts = __theAccounts;

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:

-(void)resyncAccounts {
    self.theAccounts = nil;
    [self.tableView reloadData];
}

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{}.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:10:45+00:00Added an answer on May 27, 2026 at 2:10 am

    Why don’t you reload the tableView after setting “theAccounts” in the completion handler? Also, shouldn’t you call “self.theAccounts” after setting it to nil?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following bit of code in a method called by clicking the
I have the following method public static void SerializeToXMLFile(Object obj,Type type, string fileName) {
I have the following method and interface: public object ProcessRules(List<IRule> rules) { foreach(IRule rule
I have the following utility method declared, where players is a NSMutableArray object and
I have a UITableView that I want updated by a method called by a
I have following code, but why is the ProcessExited method never called? It is
I have the following method being called in a Java EE web application. public
I have the following method which is called via Ajax: def decrement @cart =
I have the following method: -(void)SomeMethod:(id)classOrProtocol; It will be called like this: [self someMethod:@protocol(SomeProtocol)];
I have following method in wcf webenabled service Public Person AddPerson(Person p); As of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.