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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:54:23+00:00 2026-05-28T00:54:23+00:00

I have a form(table view) which contains textfields and textview as subviews,I need to

  • 0

I have a form(table view) which contains textfields and textview as subviews,I need to save the data filled in those fields.Hence I used sqlite3.Everything works fine,saving retrieving and displaying saved data.But in the table view,I have one cell which contains a button as subview.As we know that there’s no concept called checkbox button in iphone.Therefore I used button and added default image as subview shown in the following:

enter image description here

When the button is not selected,the image is unchanged.

Now that if the user selects the button the image changes to check mark indicating that the logic works every year as shown in the following:

enter image description here

Now my question is how can I save the button image in to sqlite3.I have used the following query to insert values:

NSString *insertSQL = [NSString stringWithFormat:@"INSERT INTO reminders(name,event,date,tim,bfr,num,bod,grp) VALUES (\"%@\", \"%@\", \"%@\", \"%@\", \"%@\",\"%@\", \"%@\", \"%@\")", fieldOne.text, fieldTwo.text,fieldThree.text,fieldFour.text,fieldFive.text,fieldSix.text,textView.text,fieldSeven.text];

Similarly how can I save the button with image as subview in sqlite3.I heard that there is no concept like BOOL values storage in sqlite3.Instead it is stored as int values i.e. “0” as false and “1” as true.Hence I used the following query to insert the button image:

int selValue;

if(checkboxSelected == NO)
{
    selValue = 0;
}

else if(checkboxSelected == YES)
{
    selValue = 1;
}
NSString *insertSQL = [NSString stringWithFormat:@"INSERT INTO reminders(name,event,date,tim,bfr,val,num,bod,grp) VALUES (\"%@\", \"%@\", \"%@\", \"%@\", \"%@\", \"%@\",\"%@\", \"%@\", \"%@\")", fieldOne.text, fieldTwo.text,fieldThree.text,fieldFour.text,fieldFive.text,isSelected,fieldSix.text,textView.text,fieldSeven.text]; 

In console the selValue is getting displayed as 1 if button’s selected and 0 if not.

But I have a controller page called view edit reminder,where the user can view the saved reminder and edit for changes to happen.Now I have saved a reminder called Amma,there while saving I have selected Every Year button,but its not working even though the data inserted is getting retrieved for the reminder as shown below:

enter image description here

EDIT:

The code I have implemented for retrieving the data from sqlite3 database table:

ReminderClass *remind = [[ReminderClass alloc]init];
                remind.Name = [[NSString alloc]initWithUTF8String:(const char *)sqlite3_column_text(statment, 1)];
                remind.Event = [[NSString alloc]initWithUTF8String:(const char *)sqlite3_column_text(statment, 2)];
                remind.Date = [[NSString alloc]initWithUTF8String:(const char *)sqlite3_column_text(statment, 3)];

                remind.time = [[NSString alloc]initWithUTF8String:(const char *)sqlite3_column_text(statment, 4)]; 
                remind.numDays = [[NSString alloc]initWithUTF8String:(const char *)sqlite3_column_text(statment, 5)];
                remind.selString = [[NSString alloc]initWithUTF8String:(const char *)sqlite3_column_text(statment, 6)]];
                remind.number = [[NSString alloc]initWithUTF8String:(const char *)sqlite3_column_text(statment, 7)];
                remind.msgBody = [[NSString alloc]initWithUTF8String:(const char *)sqlite3_column_text(statment, 8)];
                remind.remGroup = [[NSString alloc]initWithUTF8String:(const char *)sqlite3_column_text(statment, 9)];

EDIT:

This is what I did for editing the content:

-(void)tableView:(UITableView *)atableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

    if (aTable.editing) 
    {
        ReminderClass *rem = (ReminderClass *)[self.monthArray objectAtIndex:indexPath.section];

        // Instantiate your detail/editor view controller,
        // and pass in the ReminderClass object to be edited.
        ERAddReminderViewController *rdvc = [[[ERAddReminderViewController alloc]initWithReminder:rem]autorelease];
        [self.navigationController pushViewController:rdvc animated:YES];
    }

    [atableView deselectRowAtIndexPath:indexPath animated:YES];
}

Please help me out with your valuable suggestions

Thanks all in advance 🙂

  • 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-28T00:54:24+00:00Added an answer on May 28, 2026 at 12:54 am

    setting:

    int selValue;
    
    if(checkboxSelected == NO)
    {
        selValue = 0;
    }
    
    else if(checkboxSelected == YES)
    {
        selValue = 1;
    }
    
    
           NSNumber *number = [NSNumber numberWithInt:selValue]; 
        NSString *isSelected = [number stringValue];
    
    
     NSString *insertSQL = [NSString stringWithFormat:@"INSERT INTO reminders(name,event,date,tim,bfr,val,num,bod,grp) VALUES (\"%@\", \"%@\", \"%@\", \"%@\", \"%@\", \"%@\",\"%@\", \"%@\", \"%@\")", fieldOne.text, fieldTwo.text,fieldThree.text,fieldFour.text,fieldFive.text,isSelected,fieldSix.text,textView.text,fieldSeven.text];
    

    Get:

     remind.selString = [[[NSString alloc]initWithUTF8String:(const char *)sqlite3_column_text(statment, 6)];
    
     NSString *one = remind.selString;
         NSNumber* i = [NSNumber numberWithInt:[one intValue]];;
         BOOL isOn = [i boolValue];
    
    if(isOn){
       //set ON Image
    }
    else{
       //set OFF image
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple data table which contains dynamic form text fields. Each field
I have a table of the form CREATE TABLE data { pk INT PRIMARY
I have a table for a contact form and this table contains another table
I have a table body that grabs it's rows (and form fields) via AJAX
I have some view which lists my module table entries. What is the most
I have one column in my table which will store data in string format
I have an ASP.NET MVC view which contains checkboxes for user-defined categories. <td><% foreach
I have grid view which contains five radio buttons per row. Out of these
I have a drop down list on a form view which are both bound
I have a grid view. Which contains some columns. Suppose, it has 10 columns

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.