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 6200405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:21:41+00:00 2026-05-24T04:21:41+00:00

I have a view controller that lists some data in an UITableView . To

  • 0

I have a view controller that lists some data in an UITableView. To get the data downloaded I use ASIHTTPRequest which methods I have put in another class.

In my view controller I have setup the appropriate delegates to handle the data that is being retrieved from ASIHTTPRequest. So from my view controller in - viewDidLoad I alloc and init my class that holds the ASIHTTPRequest methods like so:

self.officesParser = [[[OfficesParser alloc] init] autorelease]; // retained property

Then in - viewDidAppear: I call [officesParser downloadOffices];

My - downloadOffices method looks like this:

- (void)downloadOffices {

    // 1. Downloaded offices.json
    NSURL *officesUrl = [NSURL URLWithString:@"http://example.com/example.json"];
    ASIHTTPRequest *officesRequest = [ASIHTTPRequest requestWithURL:officesUrl];

    // Always ask the server if there is new content available, 
    // If the request fails, use data from the cache even if it should have expired.
    [officesRequest setCachePolicy:ASIAskServerIfModifiedCachePolicy|ASIFallbackToCacheIfLoadFailsCachePolicy];

    // Store the cache permanently
    [officesRequest setCacheStoragePolicy:ASICachePermanentlyCacheStoragePolicy];

    [officesRequest setTag:1];

    OfficesViewController *vc = [[OfficesViewController alloc] init];
    [officesRequest setDelegate:vc];
    [vc release];
    [officesRequest startAsynchronous];
}

Everytime after calling the [officesParser downloadOffices] method I get:

*** -[OfficesViewController respondsToSelector:]: message sent to deallocated instance 0x6a2f6c0

What am I doing wrong here?

  • 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-24T04:21:42+00:00Added an answer on May 24, 2026 at 4:21 am

    You want vc to be delegate for officesRequest, however, after you allocate and initialize vc and set it to be the delegate, you immediately release it. Please note that delegate properties are usually assign, not retain. You are then responsible for keeping your delegate object in existence until no longer needed. So, if you plan to send messages to it in a near future, you can’t immediately release it.

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

Sidebar

Related Questions

Lets say I have a view, myView, a view controller, myViewController, and some sort
I have a view that has a list of jobs in it, with data
I have a view using a master page that contains some javascript that needs
I have a view that I want to add some custom drawing to. I
I'm building an asp.net MVC 2 app. I have a list view which lists
I have a view with a List of ViewModels that is based on data
I have a viewController (Planner) that loads two view controllers (InfoEditor and MonthlyPlan) when
A simple question: I have a Model-View-Controller setup, with Models accessing a SQL database.
I Have following code: Controller: public ActionResult Step1() { return View(); } [AcceptVerbs(HttpVerbs.Post)] public
When submitting one form from view, how can i also read or have controller

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.