Latest 1.0.7
Homepage https://github.com/wangyanlong/WYLCoreDataTableView
License MIT
Platforms ios 4.3, requires ARC
Frameworks Foundation, CoreGraphics, UIKit, CoreData
Authors

一个基于NSFetchedResultController封装的tableView

Getting Started

Using CocoaPods

1.Add the pod WYLCoreDataTableView to your Podfile.

pod 'WYLCoreDataTableView'

2.Run pod install from Terminal, then open your app’s .xcworkspace file to launch Xcode.

3.#import WYLCoreDataTableView.h wherever you want to use the API.

Manually from GitHub

1.Download the WYLCoreDataTableView.h and WYLCoreDataTableView.m files in th Source directory

2.Add both files to your Xcode project.

3.#import WYLCoreDataTableView.h wherever you want to use the API.

Example Usage

Example location

Check out the example project included in the repository. It contains a few demos of the API in use for various scenarios.

Usage

no.1 The program needs to include the CoreData related files.

no.2 Create a entity.

no.3 Create a list of inherited WYLCoreDataTableView

no.4 Configure the new tableView like this

objc

AppDelegate *app = (AppDelegate *)[UIApplication sharedApplication].delegate;

CollectionTableView *ctv = [[CollectionTableView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];

NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc]initWithKey:@"comicID" ascending:YES];
ctv.context = app.managedObjectContext;
ctv.sortArray = @[sortDescriptor];
ctv.entityName = @"Comic";
[ctv createFetchTableViewInfomation];
[ctv registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"];

[self.view addSubview:ctv];

no.5 Custom the new tableView delegate method like this

#import "Comic.h"
#import "CollectionTableView.h"

@implementation CollectionTableView

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];

Comic *c = [self.frc objectAtIndexPath:indexPath];
cell.textLabel.text = c.name;

return cell;

}

version 1.0.6

fix iOS8 bug, change cell registerClass.

version 1.0.4

Joined, when no data, to the user to display no data pages

License

MIT

Latest podspec

{
    "name": "WYLCoreDataTableView",
    "version": "1.0.7",
    "summary": "A NSFetchedResultController based on tableView",
    "description": "A NSFetchedResultController based on tableView. [email protected]",
    "homepage": "https://github.com/wangyanlong/WYLCoreDataTableView",
    "license": "MIT",
    "authors": {
        "u738bu989cu9f99": "[email protected]"
    },
    "source": {
        "git": "https://github.com/wangyanlong/WYLCoreDataTableView.git",
        "tag": "1.0.7"
    },
    "platforms": {
        "ios": "4.3"
    },
    "requires_arc": true,
    "source_files": "WYLCoreDataTableViewDemo/WYLCoreDataTableView/WYLCoreDataTableView/*.{h,m}",
    "frameworks": [
        "Foundation",
        "CoreGraphics",
        "UIKit",
        "CoreData"
    ]
}

Pin It on Pinterest

Share This