This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// GOParametricView.m | |
// CircleTest | |
// | |
// Created by Samuel Goodwin on 5/1/12. | |
// | |
#import "GOParametricView.h" | |
#import <QuartzCore/QuartzCore.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *dataPath = [weakOperation tmpFilePath]; | |
NSManagedObjectContext *context = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType]; | |
[context setParentContext:mainContext]; | |
[context performBlock:^{ | |
NSError *findingError = nil; | |
GOFeedItem *thisItem = (GOFeedItem *)[context existingObjectWithID:objectID error:&findingError]; | |
if(!thisItem){ | |
NSLog(@"Error finding item %@: %@", [feedItem title], [findingError userInfo]); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var target = UIATarget.localTarget(); | |
var app = target.frontMostApp(); | |
var window = app.mainWindow(); | |
var testName = "Dummy Test"; | |
function dummyTest(){ | |
UIALogger.logStart(testName); | |
var button = window.buttons()["Go"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | |
{ | |
switch(section){ | |
case 0: | |
return 2; | |
break; | |
case 1: | |
return [self.items count]; | |
break; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef enum { | |
RWSSectionInfo, | |
RWSSectionDynamic, | |
RWSSectionCount | |
}RWSSection; | |
const NSInteger kNumberOfInfoRows = 2; | |
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef enum { | |
RWSSectionInfo, | |
RWSSectionDynamic, | |
RWSSectionCount | |
}RWSSection; | |
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
RWSSection section = indexPath.section; | |
switch(section){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | |
{ | |
if<NSFetchedResultsSectionInfo> section = [self.resultsController sections][indexPath.section]; | |
return [section numberOfObjects]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@protocol RWSSection | |
- (NSUInteger)numberOfObjects; | |
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRow:(NSInteger)row; | |
@end | |
@interface RWSStaticSection : NSObject<RWSSection> | |
@property(nonatomic, readonly) NSArray *items; | |
@end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation RWSViewController | |
- (id)initWithStyle:(UITableViewStyle)style | |
{ | |
self = [super initWithStyle:style]; | |
if (self) { | |
RWSStaticSection *section1 = [[RWSStaticSection alloc] init]; | |
RWSStaticSection *section2 = [[RWSStaticSection alloc] init]; | |
_sections = @[section1, section2]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSArray *)dataSource | |
{ | |
return [[[self fetchedResultsController] fetchedObjects] copy]; | |
} |