Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am inserting data in sqlite table and then showing that data in table View. problem is that when i insert ABC then it show in table ABC, but when i again insert XYZ then it shows only XYZ instead of ABC and XYZ. this is method to select data which i inserted:

   NSMutableArray *tempArray3 = [[NSMutableArray alloc] init];
   self.libraryArray = tempArray3;
   [tempArray3 release];
   [Coffee getInitialDataToDisplayL:[self getDBPath]];

Adding data method:

- (void) addCoffee:(Coffee *)coffeeObj {
    //Add it to the database.
    [coffeeObj addCoffee];
    int countone=[libraryArray count];
    NSLog(@"count Before Adding is %d",countone);

    //Add it to the coffee array.
    [libraryArray addObject:coffeeObj];
    int count=[libraryArray count];
    NSLog(@"count After Adding is %d",count);
    NSLog(@"Successfully added");
}
share|improve this question
can you add addCoffee method – tausun Apr 18 at 4:19
1  
Are you opening db in Documents folder? Also, you talk about problem adding data to SQLite table, but then don't show us any SQLite code. Is the problem that it's not showing up in your array or that it's not showing up in table? If table, then show us code for updating table. You are neither showing us enough code nor providing enough detail (e.g. what do the NSLog statements report) for us to possibly help you diagnose what's going on. – Rob Apr 18 at 7:17

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.