Skip to content

Commit

Permalink
Merges Event.h
Browse files Browse the repository at this point in the history
  • Loading branch information
ZachOrr committed May 23, 2014
2 parents 996dde5 + a3e9ebc commit 6f0b666
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 39 deletions.
38 changes: 24 additions & 14 deletions the-blue-alliance-ios/Event.h → Event.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
//
// Event.h
// The Blue Alliance
// the-blue-alliance-ios
//
// Created by Donald Pinckney on 5/5/14.
// Created by Donald Pinckney on 5/22/14.
// Copyright (c) 2014 The Blue Alliance. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>

@class Team;

@interface Event : NSManagedObject

Expand All @@ -23,24 +24,33 @@ typedef enum EventType : NSInteger {
UNLABLED = -1
} EventType;

@property (nonatomic, retain) NSString * address;
@property (nonatomic, retain) NSNumber * district_enum;
@property (nonatomic, retain) NSDate * end_date;
@property (nonatomic, retain) NSString * event_short;
@property (nonatomic, retain) NSNumber * event_type;
@property (nonatomic, retain) NSString * key;
@property (nonatomic, retain) NSNumber * last_updated;
@property (nonatomic, retain) NSString * location;
@property (nonatomic, retain) NSString * name;
@property (nonatomic, retain) NSNumber * event_type;
@property (nonatomic, retain) NSNumber * official;
@property (nonatomic, retain) NSString * short_name;
@property (nonatomic, retain) NSString * event_short;
@property (nonatomic, retain) NSNumber * year;
@property (nonatomic, retain) NSNumber * district_enum;
@property (nonatomic, retain) NSDate * start_date;
@property (nonatomic, retain) NSDate * end_date;
@property (nonatomic, retain) NSString * venue;
@property (nonatomic, retain) NSString * address;
@property (nonatomic, retain) NSString * location;
@property (nonatomic, retain) NSString * stats;
@property (nonatomic, retain) NSString * timezone;
@property (nonatomic, retain) NSNumber * official;
@property (nonatomic, retain) NSString * website;
@property (nonatomic, retain) NSString * venue;
@property (nonatomic, retain) NSString * webcasts;
@property (nonatomic, retain) NSString * stats;
@property (nonatomic, retain) NSString * website;
@property (nonatomic, retain) NSNumber * year;
@property (nonatomic, retain) NSString * rankings;
@property (nonatomic, retain) NSNumber * last_updated;
@property (nonatomic, retain) NSSet *teams;
@end

@interface Event (CoreDataGeneratedAccessors)

- (void)addTeamsObject:(Team *)value;
- (void)removeTeamsObject:(Team *)value;
- (void)addTeams:(NSSet *)values;
- (void)removeTeams:(NSSet *)values;

@end
30 changes: 16 additions & 14 deletions the-blue-alliance-ios/Event.m → Event.m
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
//
// Event.m
// The Blue Alliance
// the-blue-alliance-ios
//
// Created by Donald Pinckney on 5/5/14.
// Created by Donald Pinckney on 5/22/14.
// Copyright (c) 2014 The Blue Alliance. All rights reserved.
//

#import "Event.h"
#import "Team.h"


@implementation Event

@dynamic address;
@dynamic district_enum;
@dynamic end_date;
@dynamic event_short;
@dynamic event_type;
@dynamic key;
@dynamic last_updated;
@dynamic location;
@dynamic name;
@dynamic event_type;
@dynamic official;
@dynamic short_name;
@dynamic event_short;
@dynamic year;
@dynamic district_enum;
@dynamic start_date;
@dynamic end_date;
@dynamic venue;
@dynamic address;
@dynamic location;
@dynamic stats;
@dynamic timezone;
@dynamic official;
@dynamic website;
@dynamic venue;
@dynamic webcasts;
@dynamic stats;
@dynamic website;
@dynamic year;
@dynamic rankings;
@dynamic last_updated;
@dynamic teams;

@end
34 changes: 24 additions & 10 deletions the-blue-alliance-ios.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
/* Begin PBXBuildFile section */
394BD129CFDF44B78FFF2C94 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DDCC6CCFB1A4A199C72C12E /* libPods.a */; };
5057CD1E1929987D00654304 /* SearchableCoreDataTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5057CD1D1929987D00654304 /* SearchableCoreDataTableViewController.m */; };
5070EE69192E95FA0079D123 /* Team.m in Sources */ = {isa = PBXBuildFile; fileRef = 5070EE68192E95FA0079D123 /* Team.m */; };
5070EE6C192E965C0079D123 /* Event.m in Sources */ = {isa = PBXBuildFile; fileRef = 5070EE6B192E965C0079D123 /* Event.m */; };
50832DFB1918BB63003AC8A7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50832DFA1918BB63003AC8A7 /* Foundation.framework */; };
50832DFD1918BB63003AC8A7 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50832DFC1918BB63003AC8A7 /* CoreGraphics.framework */; };
50832DFF1918BB63003AC8A7 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50832DFE1918BB63003AC8A7 /* UIKit.framework */; };
Expand All @@ -24,7 +26,6 @@
50832E271918BB63003AC8A7 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 50832E251918BB63003AC8A7 /* InfoPlist.strings */; };
50832E291918BB63003AC8A7 /* the_blue_alliance_iosTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 50832E281918BB63003AC8A7 /* the_blue_alliance_iosTests.m */; };
50832E341918BB8E003AC8A7 /* The Blue Alliance.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 50832E321918BB8E003AC8A7 /* The Blue Alliance.xcdatamodeld */; };
50832E391918BBBE003AC8A7 /* Event.m in Sources */ = {isa = PBXBuildFile; fileRef = 50832E361918BBBE003AC8A7 /* Event.m */; };
50832E3A1918BBBE003AC8A7 /* Event+Create.m in Sources */ = {isa = PBXBuildFile; fileRef = 50832E381918BBBE003AC8A7 /* Event+Create.m */; };
50832E3E1918BBEA003AC8A7 /* EventsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 50832E3D1918BBEA003AC8A7 /* EventsViewController.m */; };
50832E551918BBFF003AC8A7 /* CoreDataTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 50832E541918BBFF003AC8A7 /* CoreDataTableViewController.m */; };
Expand Down Expand Up @@ -54,6 +55,10 @@
4DDCC6CCFB1A4A199C72C12E /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
5057CD1C1929987D00654304 /* SearchableCoreDataTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SearchableCoreDataTableViewController.h; sourceTree = "<group>"; };
5057CD1D1929987D00654304 /* SearchableCoreDataTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SearchableCoreDataTableViewController.m; sourceTree = "<group>"; };
5070EE67192E95FA0079D123 /* Team.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Team.h; sourceTree = "<group>"; };
5070EE68192E95FA0079D123 /* Team.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Team.m; sourceTree = "<group>"; };
5070EE6A192E965C0079D123 /* Event.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Event.h; path = ../Event.h; sourceTree = "<group>"; };
5070EE6B192E965C0079D123 /* Event.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Event.m; path = ../Event.m; sourceTree = "<group>"; };
50832DF71918BB63003AC8A7 /* the-blue-alliance-ios.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "the-blue-alliance-ios.app"; sourceTree = BUILT_PRODUCTS_DIR; };
50832DFA1918BB63003AC8A7 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
50832DFC1918BB63003AC8A7 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
Expand All @@ -73,8 +78,6 @@
50832E261918BB63003AC8A7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
50832E281918BB63003AC8A7 /* the_blue_alliance_iosTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = the_blue_alliance_iosTests.m; sourceTree = "<group>"; };
50832E331918BB8E003AC8A7 /* The Blue Alliance.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "The Blue Alliance.xcdatamodel"; sourceTree = "<group>"; };
50832E351918BBBE003AC8A7 /* Event.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Event.h; sourceTree = "<group>"; };
50832E361918BBBE003AC8A7 /* Event.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Event.m; sourceTree = "<group>"; };
50832E371918BBBE003AC8A7 /* Event+Create.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Event+Create.h"; sourceTree = "<group>"; };
50832E381918BBBE003AC8A7 /* Event+Create.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Event+Create.m"; sourceTree = "<group>"; };
50832E3C1918BBEA003AC8A7 /* EventsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventsViewController.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -126,6 +129,15 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
5070EE6D192E966B0079D123 /* Team */ = {
isa = PBXGroup;
children = (
5070EE67192E95FA0079D123 /* Team.h */,
5070EE68192E95FA0079D123 /* Team.m */,
);
name = Team;
sourceTree = "<group>";
};
50832DEE1918BB63003AC8A7 = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -213,7 +225,8 @@
isa = PBXGroup;
children = (
50832E321918BB8E003AC8A7 /* The Blue Alliance.xcdatamodeld */,
92B98A5A192DA964004A2513 /* Events */,
5070EE6D192E966B0079D123 /* Team */,
92B98A5A192DA964004A2513 /* Event */,
);
name = "Data Model";
sourceTree = "<group>";
Expand Down Expand Up @@ -243,15 +256,15 @@
name = "Top Level Controllers";
sourceTree = "<group>";
};
92B98A5A192DA964004A2513 /* Events */ = {
92B98A5A192DA964004A2513 /* Event */ = {
isa = PBXGroup;
children = (
50832E351918BBBE003AC8A7 /* Event.h */,
50832E361918BBBE003AC8A7 /* Event.m */,
5070EE6A192E965C0079D123 /* Event.h */,
5070EE6B192E965C0079D123 /* Event.m */,
50832E371918BBBE003AC8A7 /* Event+Create.h */,
50832E381918BBBE003AC8A7 /* Event+Create.m */,
);
name = Events;
name = Event;
sourceTree = "<group>";
};
92C5B871192C0BC400AFDBCA /* Events */ = {
Expand Down Expand Up @@ -375,7 +388,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\ncat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\nexit 1\nfi\n";
showEnvVarsInLog = 0;
};
816437B6DC96402F891C1218 /* Copy Pods Resources */ = {
Expand Down Expand Up @@ -408,11 +421,12 @@
9283A261192EEE5800B9068B /* EventGroup.m in Sources */,
50832E341918BB8E003AC8A7 /* The Blue Alliance.xcdatamodeld in Sources */,
50832E3E1918BBEA003AC8A7 /* EventsViewController.m in Sources */,
50832E391918BBBE003AC8A7 /* Event.m in Sources */,
5070EE69192E95FA0079D123 /* Team.m in Sources */,
5057CD1E1929987D00654304 /* SearchableCoreDataTableViewController.m in Sources */,
50DFD20119207DCA009B686E /* TeamsViewController.m in Sources */,
92C5B870192C0BBC00AFDBCA /* YearSelectView.m in Sources */,
50832E0B1918BB63003AC8A7 /* AppDelegate.m in Sources */,
5070EE6C192E965C0079D123 /* Event.m in Sources */,
50832E071918BB63003AC8A7 /* main.m in Sources */,
50DFD1F61920365E009B686E /* MenuViewController.m in Sources */,
);
Expand Down
1 change: 1 addition & 0 deletions the-blue-alliance-ios/Event+Create.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ + (Event *)createEventFromTBAInfo:(NSDictionary *)info
event.start_date = [formatter dateFromString:info[@"start_date"]];
event.end_date = [formatter dateFromString:info[@"end_date"]];
event.event_type = info[@"event_type"];
// TODO: Finish / improve importing

NSLog(@"Imported event %@ into the database", key);
}
Expand Down
34 changes: 34 additions & 0 deletions the-blue-alliance-ios/Team.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// Team.h
// the-blue-alliance-ios
//
// Created by Donald Pinckney on 5/22/14.
// Copyright (c) 2014 The Blue Alliance. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>

@class Event;

@interface Team : NSManagedObject

@property (nonatomic, retain) NSString *key;
@property (nonatomic, retain) NSNumber *number;
@property (nonatomic, retain) NSString *name;
@property (nonatomic, retain) NSString *nickname;
@property (nonatomic, retain) NSString *address;
@property (nonatomic, retain) NSNumber *last_updated;

@property (nonatomic, retain) NSSet *events;
@end

@interface Team (CoreDataGeneratedAccessors)

- (void)addEventsObject:(Event *)value;
- (void)removeEventsObject:(Event *)value;

- (void)addEvents:(NSSet *)values;
- (void)removeEvents:(NSSet *)values;

@end
23 changes: 23 additions & 0 deletions the-blue-alliance-ios/Team.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// Team.m
// the-blue-alliance-ios
//
// Created by Donald Pinckney on 5/22/14.
// Copyright (c) 2014 The Blue Alliance. All rights reserved.
//

#import "Team.h"
#import "Event.h"


@implementation Team

@dynamic key;
@dynamic number;
@dynamic name;
@dynamic nickname;
@dynamic address;
@dynamic last_updated;
@dynamic events;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,19 @@
<attribute name="webcasts" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="website" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="year" optional="YES" attributeType="Integer 32" defaultValueString="0" syncable="YES"/>
<relationship name="teams" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="Team" inverseName="events" inverseEntity="Team" syncable="YES"/>
</entity>
<entity name="Team" representedClassName="Team" syncable="YES">
<attribute name="address" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="key" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="last_updated" optional="YES" attributeType="Integer 64" defaultValueString="0" syncable="YES"/>
<attribute name="name" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="nickname" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="number" optional="YES" attributeType="Integer 32" defaultValueString="0" syncable="YES"/>
<relationship name="events" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="Event" inverseName="teams" inverseEntity="Event" syncable="YES"/>
</entity>
<elements>
<element name="Event" positionX="448" positionY="1683" width="128" height="328"/>
<element name="Event" positionX="-1395" positionY="1895" width="128" height="343"/>
<element name="Team" positionX="-1071" positionY="2016" width="128" height="148"/>
</elements>
</model>

1 comment on commit 6f0b666

@ZachOrr
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... I broke something here with the event model. The table view now comes up empty (see #4)

Please sign in to comment.