的回報,我有錯誤面臨麻煩幫我請與UIApplicationMain
2013-02-21 18:43:54.471 BPApp[12574:c07] *** Assertion failure in -[MainViewController saveEntry:], /Users/Apple/Desktop/BPApp/BPApp/MainViewController.m:66 2013-02-21 18:43:54.473 BPApp[12574:c07] ***
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not update table' *** First throw call stack: (0x2091012 0x119ee7e 0x2090e78 0xc34f35 0x313d 0x11b2705 0xe9920 0xe98b8 0x1aa671 0x1aabcf 0x1a9d38 0x11933f 0x119552 0xf73aa 0xe8cf8 0x1fecdf9 0x1fecad0 0x2006bf5 0x2006962 0x2037bb6 0x2036f44 0x2036e1b 0x1feb7e3 0x1feb668 0xe665c 0x263d 0x2565) libc++abi.dylib: terminate called throwing an exception.
(IBAction)saveEntry:(id)sender
{
int systolic = [systolicText.text intValue];
int diastolic = [diastolicText.text intValue];
NSString *comments = commentsText.text;
NSDate *theDate = [NSDate date];
NSString *sql = [NSString stringWithFormat:@"INSERT INTO summary('theDate', 'systolic', 'diastolic', 'comments') VALUES ('%@', '%d', '%d', '%@')", theDate, systolic, diastolic, comments];
char *err;
if (sqlite3_exec(db, [sql UTF8String], NULL, NULL, &err) !=SQLITE_OK) {
sqlite3_close(db);
NSAssert(0, @"Could not update table");
}else{
NSLog(@"table updated");
}
systolicText.text [email protected]"";
diastolicText.text [email protected]"";
commentsText.text [email protected]"";
}
是我mainviewcontroller.m
我不明白。告訴我,我是一個年輕的 – 2013-02-21 12:52:14
你有沒有叫做saveEntry的functin?它有{符號嗎? – user247 2013-02-21 12:58:16