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 8776129

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:58:37+00:00 2026-06-13T18:58:37+00:00

I’m trying to pull articles out of an sqlite database and display them in

  • 0

I’m trying to pull articles out of an sqlite database and display them in a table view. When a table cell is selected, a webview is supposed to be displayed with the source page. So far everything works except displaying the source page. Here is some of my code:

(in the init method)

    articles = [[NSMutableArray alloc] init];
    webPages = [[NSMutableArray alloc] init];
    int arrayCount = data.count;
    int i;
    for (i = 0; i < arrayCount; i++) {
        Item *currentItem = [[Item alloc] init];
        currentItem = [data objectAtIndex:i];
        [articles insertObject:currentItem.itemTitle atIndex:i];
        [webPages insertObject:currentItem.detailURL atIndex:i];
        NSLog(@"%@", [webPages objectAtIndex:i]);
        //[webPages insertObject:@"http://onlyfans.cstv.com/schools/tul/sports/w-volley/recaps/102812aaa.html" atIndex:i];  -- >this works fine. i got this url from the nslog above.

    }

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath    *)indexPath {
    WebViewController *webViewController = [[WebViewController alloc] initWithString:[webPages objectAtIndex:
    indexPath.row]];
    [self.parentViewController.navigationController pushViewController:webViewController animated:YES];

This is the method for getting the information about each article from the database …

if(sqlite3_open([self.databasePath UTF8String], &database) == SQLITE_OK) {

    NSLog(@"DataLoader::readItemsFromDatabase : database open successful!");

    sqlite3_stmt *compiledStatement;

    if(sqlite3_prepare_v2(database, [sqlStatement UTF8String], -1, &compiledStatement, NULL) == SQLITE_OK) {
        NSLog(@"select ok.");
        // Loop through the results and add them to the feeds array
        while(sqlite3_step(compiledStatement) == SQLITE_ROW) {
            // Read the data from the result row

            int lineItemsID=sqlite3_column_int(compiledStatement, 0);

            NSLog(@"DataLoader::readItemsFromDatabase : source id [%i]", lineItemsID);

            NSString *aItemTitle = @" ";
            NSString *aPublishDate = @" ";
            NSString *aDetailURL = @" ";
            NSString *aDesc = @" ";

            if (sqlite3_column_text(compiledStatement, 2) != nil) {
                aItemTitle=[NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 2)];
                NSLog(@"DataLoader::readItemsFromDatabase :row>>id %i, itemTitle %s",lineItemsID,sqlite3_column_text(compiledStatement, 2));
                // NSLog(@"DataLoader::readSourcesFromDatabase :row>>id %i, name %s",lineItemsID,aItemTitleL);
            }

            if (sqlite3_column_text(compiledStatement, 3) != nil) {
                aPublishDate=[NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 3)];
                NSLog(@"DataLoader::readItemsFromDatabase :row>>id %i, publishDate %s",lineItemsID,sqlite3_column_text(compiledStatement, 3));
            }

            if (sqlite3_column_text(compiledStatement, 4) != nil) {
                aDetailURL=[NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 4)];
                NSLog(@"DataLoader::readItemsFromDatabase :row>>id %i, detail URL %s",lineItemsID,sqlite3_column_text(compiledStatement, 4));

            }

            if (sqlite3_column_text(compiledStatement, 5) != nil) {
                aDesc=[NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 5)];
                NSLog(@"DataLoader::readItemsFromDatabase :row>>id %i, desc %s",lineItemsID,sqlite3_column_text(compiledStatement, 5));
            }

            Item  *item= [[Item alloc] init];
            item.itemTitle = aItemTitle;
            item.publishDate = aPublishDate;
            item.detailURL = aDetailURL;
            item.desc = aDesc;

I can’t understand why I can get the URL string from the currentItem object and display it in an NSLog, but I can’t use it directly to open a webview. Anybody ever had this kind of problem?

Thanks for your help!

Savanna

  • 0 0 Answers
  • 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-06-13T18:58:39+00:00Added an answer on June 13, 2026 at 6:58 pm

    Try to nslog:

    [webPages objectAtIndex:indexPath.row];
    

    in your didSelectRowAtIndexPath, and see what it return.

    Also the problem might be where you declare your webPages. Try to use:

    @property(nonatomic, strong) NSMutableArray *webPages;
    

    synthesize:

    webPages = _webPages;
    

    and try to init you webPages in viewDidLoad:

    self.webPages = [[NSMutableArray alloc] init];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a view passing on information from a database: def serve_article(request, id): served_article
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.