0
A
回答
0
您需要某種類型的持久性存儲。根據您添加的內容,您可能能夠使用NSUserDefaults,或者您可能需要.plist,或者您可能需要像Core Data這樣更強大的功能。如果不知道你的需求,真的很難說。
0
我已經做了一個添加到收藏夾concept.First你創建一個表(id,fieldname1,fieldname2,狀態)在sqlite.Then插入你的數據到相應的領域。這是我的code.i剛剛通過ID和更新居留制
- (空)了updateData {
NSString * dt=show.id;
const char *sql = "update quotesdet set status = ? where id = ?;";
if ((sqlite3_prepare_v2(database, sql, -1, &updateStmt, NULL))!=SQLITE_OK)
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"DatabaseNotAvailable", @"") message:[NSString stringWithUTF8String:sqlite3_errmsg(database)]
delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alert show];
[alert release];
}
NSString *s = @"true";
sqlite3_bind_text(updateStmt, 1, [s UTF8String], -1, SQLITE_TRANSIENT);
NSInteger n = [dt intValue];
sqlite3_bind_int(updateStmt, 2, n);
int success = sqlite3_step(updateStmt);
if (success == SQLITE_ERROR) {
NSAssert1(0, @"Error: failed to insert into the database with message '%s'.", sqlite3_errmsg(database));
//return NO;
}
else {
sqlite3_finalize(updateStmt);
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Message" message:@"Added Successfully"
delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alert show];
[alert release];
}
}
相關問題
- 1. 「添加到收藏夾」 選項,在音板的應用程序
- 2. 添加到收藏夾功能[swift]
- 3. 添加到收藏夾功能iPhone
- 4. 添加到收藏夾功能?
- 5. 添加到收藏夾功能
- 6. 將UINavigationController添加到xCode選項卡欄應用程序模板
- 7. 使用jQuery將選項卡功能添加到選項卡
- 8. 如何將選項卡添加到Xcode上的選項卡式應用程序
- 9. Angular添加到收藏夾
- 10. 添加到收藏夾,jquery
- 11. Magento添加到收藏夾
- 12. 添加到收藏夾
- 13. 添加到收藏夾Array
- 14. (Django/HTML)如何創建添加到收藏夾功能
- 15. 將AJAX'添加到收藏夾'添加到此控制器?
- 16. 如何將選項卡添加到TabView
- 17. 添加到收藏夾使用共享首選項的功能Android
- 18. Php將文章添加到收藏夾
- 19. 將應用程序添加到新的頁面選項卡?
- 20. 將選項卡添加到我的sencha觸摸應用程序
- 21. 如何將教程功能添加到應用程序?
- 22. 如何將暫停/恢復功能添加到應用程序?
- 23. 如何將功能添加到iPhone應用程序?
- 24. 如何將iOS「Open In ...」功能添加到應用程序
- 25. 如何將Windows 7功能區添加到WTL應用程序
- 26. 「添加到收藏夾」用JavaScript在Opera
- 27. 如何將選項卡添加到選項卡欄控制器? (iOS)
- 28. 如何從應用程序添加視頻到收藏?
- 29. 如何將選項和習俗添加到jQuery應用程序
- 30. 將選項卡添加到Outlook 2010功能區?
您的問題是相當廣泛的,你可以解決你想具體是什麼添加爲最愛?音樂,聯繫人等 – Stunner 2011-05-17 00:10:50