iphone - Adding data in sqlite table using array store only last entered records -
i inserting data in sqlite table , showing data in table view. problem when insert abc show in table abc, when again insert xyz shows xyz instead of abc , xyz. method select data inserted:
nsmutablearray *temparray3 = [[nsmutablearray alloc] init]; self.libraryarray = temparray3; [temparray3 release]; [coffee getinitialdatatodisplayl:[self getdbpath]];
adding data method:
- (void) addcoffee:(coffee *)coffeeobj { //add database. [coffeeobj addcoffee]; int countone=[libraryarray count]; nslog(@"count before adding %d",countone); //add coffee array. [libraryarray addobject:coffeeobj]; int count=[libraryarray count]; nslog(@"count after adding %d",count); nslog(@"successfully added"); }
Comments
Post a Comment