#import "ViewController.h"
//定义宏方便引用
@interface ViewController ()
@end
@implementation ViewController
@synthesize name;
@synthesize classname;
@synthesize num;
//ps;;如果出现未能识别的错误,那那个错误很可能跟控件的输入输出口错误有关。主要是逻辑错误
-(NSString*)databasePath //===========我把加载数据和获得路径的过程封装为一个方法
{
NSString *docsDir;
NSArray *dirPaths;
dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
docsDir = [dirPaths objectAtIndex:0];
NSString *databasePath = [[NSString alloc] initWithString:[docsDir stringByAppendingPathComponent:@"info.db"]];//新建一个数据的名字
return databasePath; //返回路径
}
- (IBAction)touch:(id)sender {
[NSThread sleepForTimeInterval:0.1]; //延迟动作发生产生一点动画效果