91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 46KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-12
  • 語言: 其他
  • 標簽: CoreData??

資源簡介

CoreData練習文件,對數據庫的增刪改查和對數據庫的版本管理等....

資源截圖

代碼片段和文件信息

//
//??AppDelegate.m
//??CoreDataProject
//
//??Created?by?代表月亮?on?13-12-5.
//??Copyright?(c)?2013年?lanou.?All?rights?reserved.
//

#import?“AppDelegate.h“
#import?“Teacher.h“
#import?“Student.h“
@implementation?AppDelegate

@synthesize?managedobjectContext?=?_managedobjectContext;
@synthesize?managedobjectModel?=?_managedobjectModel;
@synthesize?persistentStoreCoordinator?=?_persistentStoreCoordinator;

-?(BOOL)application:(UIApplication?*)application?didFinishLaunchingWithOptions:(NSDictionary?*)launchOptions
{
????NSString?*docpath=[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory?NSUserDomainMask?YES)lastobject];
????NSLog(@“%@“docpath);
????self.window?=?[[UIWindow?alloc]?initWithframe:[[UIScreen?mainScreen]?bounds]];
????//?Override?point?for?customization?after?application?launch.
????self.window.backgroundColor?=?[UIColor?whiteColor];
????[self.window?makeKeyAndVisible];
????
????//使用管理器類創建數據庫
?????[self?managedobjectContext];
????//創建實體描述信息
????/*NSEntityDescription?*entityDescription=[NSEntityDescription?entityForName:@“Teacher“?inManagedobjectContext:self.managedobjectContext];
????//??//獲取數據管理器工具類幫忙創建的實體對象
????Teacher?*teacher=[[Teacher?alloc]initWithEntity:entityDescription?insertIntoManagedobjectContext:self.managedobjectContext];
????//下面就可以對teacher中的所有屬性進行修改
????teacher.name=@“lichanghong“;
????teacher.age=[NSNumber?numberWithInteger:18];
????NSLog(@“%@“teacher);
????//將變化后的數據管理工具類保存
????[self?saveContext];
????/*/
????//獲取數據庫管理工具類中已經包含的對象
????//1創建請求對象
????NSFetchRequest?*request=[NSFetchRequest?fetchRequestWithEntityName:@“Teacher“];
????//2執行請求對象獲取請求結果
????NSArray?*teachers=[self.managedobjectContext?executeFetchRequest:request?error:nil];
????NSLog(@“%@“teachers);
????
????/*/刪除第一條數據
????[self.managedobjectContext?deleteobject:teachers[0]];
????[self?saveContext];
????*/
????/*/創建學生實體描述信息
????NSEntityDescription?*studentDescription=[NSEntityDescription?entityForName:@“Student“?inManagedobjectContext:self.managedobjectContext];
????//獲取學生實體的實例對象
????Student?*student=[[Student?alloc]initWithEntity:studentDescription?insertIntoManagedobjectContext:self.managedobjectContext];
????student.name=@“lichanghong“;
????[self?saveContext];
????
????//將學生對象添加到第一個entity實例對象內
????//?[firstEntity?addStudentListobject:student];
????[self?saveContext];
*/
????
????return?YES;
}

-?(void)applicationWillResignActive:(UIApplication?*)application
{
????//?Sent?when?the?application?is?about?to?move?from?active?to?inactive?state.?This?can?occur?for?certain?types?of?temporary?interruptions?(such?as?an?incoming?phone?call?or?SMS?message)?or?when?the?user?quits?the?application?and?it?begins?the?transition?to?the?background?state.
????//?Use?this?method?to?pause?ongoing?tasks?disable?timers?and?throttle?down?OpenGL?ES?frame?rates.?Games?should?use?this?method?to?pause?the?game.
}

-?(void)applicationDidEnterBackground:(UIApplication?*)application
{
????//?Use?this?method?to?release?shared?resources?save?user?data?invalidate?timers?an

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2013-12-05?17:07??CoreDataProject\
?????文件????????6148??2013-12-05?19:55??CoreDataProject\.DS_Store
?????目錄???????????0??2013-12-05?19:55??__MACOSX\
?????目錄???????????0??2013-12-05?19:55??__MACOSX\CoreDataProject\
?????文件??????????82??2013-12-05?19:55??__MACOSX\CoreDataProject\._.DS_Store
?????目錄???????????0??2013-12-05?19:44??CoreDataProject\CoreDataProject\
?????文件????????6148??2013-12-05?19:20??CoreDataProject\CoreDataProject\.DS_Store
?????目錄???????????0??2013-12-05?19:55??__MACOSX\CoreDataProject\CoreDataProject\
?????文件??????????82??2013-12-05?19:20??__MACOSX\CoreDataProject\CoreDataProject\._.DS_Store
?????文件?????????614??2013-12-05?15:20??CoreDataProject\CoreDataProject\AppDelegate.h
?????文件?????????171??2013-12-05?15:20??__MACOSX\CoreDataProject\CoreDataProject\._AppDelegate.h
?????文件????????8711??2013-12-05?19:44??CoreDataProject\CoreDataProject\AppDelegate.m
?????文件?????????171??2013-12-05?19:44??__MACOSX\CoreDataProject\CoreDataProject\._AppDelegate.m
?????文件????????1161??2013-12-05?15:20??CoreDataProject\CoreDataProject\CoreDataProject-Info.plist
?????文件?????????378??2013-12-05?15:20??CoreDataProject\CoreDataProject\CoreDataProject-Prefix.pch
?????文件?????????171??2013-12-05?15:20??__MACOSX\CoreDataProject\CoreDataProject\._CoreDataProject-Prefix.pch
?????目錄???????????0??2013-12-05?19:26??CoreDataProject\CoreDataProject\CoreDataProject.xcdatamodeld\
?????文件?????????270??2013-12-05?19:11??CoreDataProject\CoreDataProject\CoreDataProject.xcdatamodeld\.xccurrentversion
?????目錄???????????0??2013-12-05?19:26??CoreDataProject\CoreDataProject\CoreDataProject.xcdatamodeld\CoreDataProject?2.xcdatamodel\
?????文件????????1228??2013-12-05?19:26??CoreDataProject\CoreDataProject\CoreDataProject.xcdatamodeld\CoreDataProject?2.xcdatamodel\contents
?????目錄???????????0??2013-12-05?18:52??CoreDataProject\CoreDataProject\CoreDataProject.xcdatamodeld\CoreDataProject.xcdatamodel\
?????文件????????1018??2013-12-05?18:52??CoreDataProject\CoreDataProject\CoreDataProject.xcdatamodeld\CoreDataProject.xcdatamodel\contents
?????目錄???????????0??2013-12-05?15:20??CoreDataProject\CoreDataProject\en.lproj\
?????文件??????????45??2013-12-05?15:20??CoreDataProject\CoreDataProject\en.lproj\InfoPlist.strings
?????目錄???????????0??2013-12-05?19:55??__MACOSX\CoreDataProject\CoreDataProject\en.lproj\
?????文件?????????171??2013-12-05?15:20??__MACOSX\CoreDataProject\CoreDataProject\en.lproj\._InfoPlist.strings
?????目錄???????????0??2013-12-05?15:20??CoreDataProject\CoreDataProject\Images.xcassets\
?????目錄???????????0??2013-12-05?15:20??CoreDataProject\CoreDataProject\Images.xcassets\AppIcon.appiconset\
?????文件?????????333??2013-12-05?15:20??CoreDataProject\CoreDataProject\Images.xcassets\AppIcon.appiconset\Contents.json
?????目錄???????????0??2013-12-05?19:55??__MACOSX\CoreDataProject\CoreDataProject\Images.xcassets\
?????目錄???????????0??2013-12-05?19:55??__MACOSX\CoreDataProject\CoreDataProject\Images.xcassets\AppIcon.appiconset\
............此處省略33個文件信息

評論

共有 條評論