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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:38:47+00:00 2026-05-25T16:38:47+00:00

Basically, from the root of the navigation controller, a table view, I build a

  • 0

Basically, from the root of the navigation controller, a table view, I build a URL string that contains the information i want to display on the new tableView. in the new table view i use the URL for an NSURL request. My code gives me no error but crashes, right after the NSLog: made cells. help before i kill myself. sorry should all be together but copy pasting code obviously doesn’t work well.

#import "CatDisplayViewController.h"
#import "CatViewController.h"


implementation CatDisplayViewController

@synthesize downvotebutton;
@synthesize upvotebutton;
//@synthesize tripsHold;
@synthesize URLtoUse;






NSArray *trips;


- (void)viewDidLoad {
[super viewDidLoad];



NSURL *url = [NSURL URLWithString:URLtoUse];

NSLog(@"%@", url);

responseData = [[NSMutableData data] retain];

NSURLRequest *request = [NSURLRequest requestWithURL:url];
[[NSURLConnection alloc] initWithRequest:request delegate:self];

}

- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
NSLog(@" recieved response ");
[responseData setLength:0];

}

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
NSLog(@" Did recieve data ");
[responseData appendData:data];

}

- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
NSLog(@" connection failed ");
NSLog(@"%@", error);

}

- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
[connection release];
NSLog(@" our connect finished loading");
NSString *responseString = [[NSString alloc] initWithData:responseData     encoding:NSUTF8StringEncoding];
[responseData release];

NSLog(@"%@", responseString);

NSLog(@" released data ");
NSDictionary *results = [responseString JSONValue];
NSLog(@" built JSON dictionary ");
NSArray *allTrips = [results objectForKey:@"results"];
NSLog(@" built array from dictionary ");

trips = allTrips;
NSLog(@" done with connectFinish method ");

[self.tableView reloadData];

}

#pragma mark -
#pragma mark Table view data source



- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
// Return the number of sections.

NSLog(@" in sections number ");

return 1;

}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
// Return the number of rows in the section.
NSLog(@"%@", trips);
return [trips count];

}

 - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
   NSLog(@" in height for row ");
return 80;
}


// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@" Trying to build table ");
static NSString *CellIdentifier = @"Cell";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
}

// Configure the cell...
NSLog(@"made cells");

NSDictionary *trip = [trips objectAtIndex:[indexPath row]];

NSLog(@" made dictionary from array ");

cell.textLabel.text = [trip objectForKey:@"txt"];
cell.textLabel.adjustsFontSizeToFitWidth = YES;
cell.textLabel.font = [UIFont systemFontOfSize:12];
cell.textLabel.minimumFontSize = 10;
cell.textLabel.numberOfLines = 4;
cell.textLabel.lineBreakMode = UILineBreakModeWordWrap;

cell.detailTextLabel.text = [trip objectForKey:@"name"];

UIButton *upvote =[UIButton buttonWithType:UIButtonTypeRoundedRect];

UIImage *upVoteBack = [UIImage imageNamed:@"arrowup.png"];
[upvote setBackgroundImage:upVoteBack forState:UIControlStateNormal];
[upvote setTitle:@"+" forState:UIControlStateNormal];
upvote.frame = CGRectMake(250.0f, 40.0f, 25.0f, 25.0f);
[upvote addTarget:self action:@selector(upvoteaction:)forControlEvents:UIControlEventTouchUpInside];
[cell addSubview:upvote];

UIButton *downvote =[UIButton buttonWithType:UIButtonTypeRoundedRect];
UIImage *downVoteBack = [UIImage imageNamed:@"arrowdown.png"];
[upvote setBackgroundImage:downVoteBack forState:UIControlStateNormal];
[downvote setTitle:@"-" forState:UIControlStateNormal];
downvote.frame = CGRectMake(250.0f, 40.0f, 25.0f, 25.0f);
[downvote addTarget:self action:@selector(downvoteaction:)forControlEvents:UIControlEventTouchUpInside];
[cell addSubview:downvote];



//NSURL *url = [NSURL URLWithString:[aTweet objectForKey:@"profile_image_url"]];
//NSData *data = [NSData dataWithContentsOfURL:url];
//cell.imageView.image = [UIImage imageWithData:data];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;

}

  • 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-25T16:38:47+00:00Added an answer on May 25, 2026 at 4:38 pm
    trips = [allTrips retain];
    

    Your trips array is being autoreleased – try retaining it and see if you still get the error.

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

Sidebar

Related Questions

basically I want to know if the view controller I'm in is the root
Basically I want to alter the boolean value selecting from the table: e.g.: SELECT
I have a UINavigationController , and push from the root view controller to the
Basically I want to extract the absolute path from a node to root and
I have a controller that I want to refactor. This controller basically renders a
Basically I pull an Id from table1, use that id to find a site
Root access is possible. Basically I need a way to read content: //settings/system/alarm_alert from
So I have a table that's basically a tree. Each row has a parent
How can I change the document root of the Apache server? I basically want
Basically I need to return some data from a SQL Server table in the

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.