NSUInteger row=indexPath.row;
NSString *s=[NSString stringWithFormat:@"%d",row];
NSLog(s);
}
//设置行高
12@A$)2B$$AC3D)
2,DD6
'95E+
8
6,CoreData 核心数据
添加开发支持
1)点击FRAMEWORKS目录,右键添加FRAMWORK中的CORE
DATA
2)双击生成的XCDATAMODEL文件
3)添加对象和属性,建立关系
4)FILE-NEW FILE-COCOATOUCHCLASS-MAN
AGEDOBJECTCLASS
在H文件中声明
NSManagedObjectContext * manageObjectCon;
@property (nonatomic,retain)NSManagedObjectContext *manageObjectCon;
在M文件中
@synthesize manageObjectCon;
-(NSManagedObjectContext *)manageObjectCon{
if(manageObjectCon==nil){
NSArray
*paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
NSString *basePath=([paths count]>0) ? [paths
objectAtIndex:0]:nil;
NSURL*url=[NSURL fileURLWithPath:[basePath
stringByAppendingPathComponent:@"books.sqlite"]];
NSError*err;
NSPersistentStoreCoordinator*persistentStoreCoordinator=
[[NSPersistentStoreCoordinator
alloc]initWithManagedObjectModel:[NSManagedObjectModel
mergedModelFromBundles:nil]];
if(![persistentStoreCoordinator
addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:url
options:nil error:&err])
{
NSLog(@"Failed to add persistent store with type to
persistent store coordinator");