資源簡介
利用 CoreData 框架來構建簡易的成績管理系統
具體內容:利用表視圖和 CoreData 框架來實現學生成績的增、刪、查 和找。

代碼片段和文件信息
//
//??AppDelegate.m
//??CoreDataTest
//
//??Created?by?Joyce?on?11/9/15.
//??Copyright???2015?Joyce.?All?rights?reserved.
//
#import?“AppDelegate.h“
@interface?AppDelegate?()
@end
@implementation?AppDelegate
-?(BOOL)application:(UIApplication?*)application?didFinishLaunchingWithOptions:(NSDictionary?*)launchOptions?{
????//?Override?point?for?customization?after?application?launch.
????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?and?store?enough?application?state?information?to?restore?your?application?to?its?current?state?in?case?it?is?terminated?later.
????//?If?your?application?supports?background?execution?this?method?is?called?instead?of?applicationWillTerminate:?when?the?user?quits.
}
-?(void)applicationWillEnterForeground:(UIApplication?*)application?{
????//?Called?as?part?of?the?transition?from?the?background?to?the?inactive?state;?here?you?can?undo?many?of?the?changes?made?on?entering?the?background.
}
-?(void)applicationDidBecomeActive:(UIApplication?*)application?{
????//?Restart?any?tasks?that?were?paused?(or?not?yet?started)?while?the?application?was?inactive.?If?the?application?was?previously?in?the?background?optionally?refresh?the?user?interface.
}
-?(void)applicationWillTerminate:(UIApplication?*)application?{
????//?Called?when?the?application?is?about?to?terminate.?Save?data?if?appropriate.?See?also?applicationDidEnterBackground:.
????//?Saves?changes?in?the?application‘s?managed?object?context?before?the?application?terminates.
????[self?saveContext];
}
#pragma?mark?-?Core?Data?stack
@synthesize?managedobjectContext?=?_managedobjectContext;
@synthesize?managedobjectModel?=?_managedobjectModel;
@synthesize?persistentStoreCoordinator?=?_persistentStoreCoordinator;
-?(NSURL?*)applicationDocumentsDirectory?{
????//?The?directory?the?application?uses?to?store?the?Core?Data?store?file.?This?code?uses?a?directory?named?“zoom.CoreDataTest“?in?the?application‘s?documents?directory.
????return?[[[NSFileManager?defaultManager]?URLsForDirectory:NSDocumentDirectory?inDomains:NSUserDomainMask]?lastobject];
}
-?(NSManagedobjectModel?*)managedobjectModel?{
????//?The?managed?object?model?for?the?application.?It?is?a?fatal?error?for?the?application?not?to?be?able?to?find?and?load?its?model.
????if?(_managedobjectModel?!=?nil)?{
????????return?_managedobjectModel;
????}
????NSURL?*modelURL?=?[[NSBundle?mainBu
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2015-11-10?20:58??CoreDataTest\
?????文件????????6148??2015-11-10?22:51??CoreDataTest\.DS_Store
?????目錄???????????0??2015-11-22?09:56??__MACOSX\
?????目錄???????????0??2015-11-22?09:56??__MACOSX\CoreDataTest\
?????文件?????????120??2015-11-10?22:51??__MACOSX\CoreDataTest\._.DS_Store
?????目錄???????????0??2015-11-15?14:49??CoreDataTest\.git\
?????文件??????????15??2015-11-09?21:53??CoreDataTest\.git\COMMIT_EDITMSG
?????文件?????????137??2015-11-09?21:53??CoreDataTest\.git\config
?????文件??????????73??2015-11-09?21:53??CoreDataTest\.git\desc
?????文件??????????23??2015-11-09?21:53??CoreDataTest\.git\HEAD
?????目錄???????????0??2015-11-10?07:55??CoreDataTest\.git\hooks\
?????文件?????????177??2015-11-09?21:53??CoreDataTest\.git\hooks\README.sample
?????文件????????3176??2015-11-10?07:42??CoreDataTest\.git\index
?????目錄???????????0??2015-11-10?07:55??CoreDataTest\.git\info\
?????文件??????????40??2015-11-09?21:53??CoreDataTest\.git\info\exclude
?????目錄???????????0??2015-11-22?09:56??__MACOSX\CoreDataTest\.git\
?????目錄???????????0??2015-11-22?09:56??__MACOSX\CoreDataTest\.git\info\
?????文件?????????171??2015-11-09?21:53??__MACOSX\CoreDataTest\.git\info\._exclude
?????目錄???????????0??2015-11-10?07:55??CoreDataTest\.git\logs\
?????文件?????????173??2015-11-09?21:53??CoreDataTest\.git\logs\HEAD
?????目錄???????????0??2015-11-10?07:55??CoreDataTest\.git\logs\refs\
?????目錄???????????0??2015-11-10?07:55??CoreDataTest\.git\logs\refs\heads\
?????文件?????????173??2015-11-09?21:53??CoreDataTest\.git\logs\refs\heads\master
?????目錄???????????0??2015-11-10?07:55??CoreDataTest\.git\ob
?????目錄???????????0??2015-11-10?07:55??CoreDataTest\.git\ob
?????文件??????????53??2015-11-09?21:53??CoreDataTest\.git\ob
?????文件?????????164??2015-11-09?21:53??CoreDataTest\.git\ob
?????目錄???????????0??2015-11-10?07:55??CoreDataTest\.git\ob
?????文件?????????161??2015-11-09?21:53??CoreDataTest\.git\ob
?????文件?????????306??2015-11-09?21:53??CoreDataTest\.git\ob
?????目錄???????????0??2015-11-10?07:55??CoreDataTest\.git\ob
............此處省略153個文件信息
- 上一篇:IOS簡易的成績管理系統
- 下一篇:ROS+VLAN25條ADSL 多線拔號
評論
共有 條評論