Skip to content

Commit

Permalink
Add Core Data model
Browse files Browse the repository at this point in the history
  • Loading branch information
thoughtadvances committed Mar 4, 2013
1 parent 137bac9 commit 2b45c4c
Show file tree
Hide file tree
Showing 9 changed files with 207 additions and 0 deletions.
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model name="" userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="1811" systemVersion="12C3012" minimumToolsVersion="Xcode 4.3" macOSVersion="Automatic" iOSVersion="Automatic">
<entity name="Photo" representedClassName="Photo" syncable="YES">
<attribute name="latitude" optional="YES" attributeType="Double" defaultValueString="0.0" syncable="YES"/>
<attribute name="longitude" optional="YES" attributeType="Double" defaultValueString="0.0" syncable="YES"/>
<attribute name="subtitle" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="title" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="unique" optional="YES" attributeType="String" syncable="YES"/>
<relationship name="place" optional="YES" minCount="1" maxCount="1" deletionRule="Nullify" destinationEntity="Place" inverseName="photos" inverseEntity="Place" syncable="YES"/>
<relationship name="tags" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="Tag" inverseName="photo" inverseEntity="Tag" syncable="YES"/>
</entity>
<entity name="Place" representedClassName="Place" syncable="YES">
<attribute name="city" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="country" optional="YES" attributeType="String" syncable="YES"/>
<relationship name="photos" optional="YES" minCount="1" maxCount="1" deletionRule="Nullify" destinationEntity="Photo" inverseName="place" inverseEntity="Photo" syncable="YES"/>
<relationship name="vacation" optional="YES" minCount="1" maxCount="1" deletionRule="Nullify" destinationEntity="Vacation" inverseName="places" inverseEntity="Vacation" syncable="YES"/>
</entity>
<entity name="Tag" representedClassName="Tag" syncable="YES">
<attribute name="value" optional="YES" attributeType="String" syncable="YES"/>
<relationship name="photo" optional="YES" minCount="1" maxCount="1" deletionRule="Nullify" destinationEntity="Photo" inverseName="tags" inverseEntity="Photo" syncable="YES"/>
</entity>
<entity name="Vacation" representedClassName="Vacation" syncable="YES">
<attribute name="name" optional="YES" attributeType="String" syncable="YES"/>
<relationship name="places" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="Place" inverseName="vacation" inverseEntity="Place" syncable="YES"/>
</entity>
<elements>
<element name="Photo" positionX="160" positionY="192" width="128" height="148"/>
<element name="Place" positionX="367" positionY="153" width="128" height="103"/>
<element name="Vacation" positionX="369" positionY="296" width="128" height="73"/>
<element name="Tag" positionX="153" positionY="84" width="128" height="73"/>
</elements>
</model>
31 changes: 31 additions & 0 deletions FlickrExplorer/Core Data/Photo.h
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// Photo.h
// FlickrExplorer
//
// Created by admin on 4/M/13.
// Copyright (c) 2013 ThoughtAdvances. All rights reserved.
//

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


@interface Photo : NSManagedObject

@property (nonatomic, retain) NSString * title;
@property (nonatomic, retain) NSString * unique;
@property (nonatomic, retain) NSNumber * latitude;
@property (nonatomic, retain) NSNumber * longitude;
@property (nonatomic, retain) NSString * subtitle;
@property (nonatomic, retain) NSManagedObject *place;
@property (nonatomic, retain) NSSet *tags;
@end

@interface Photo (CoreDataGeneratedAccessors)

- (void)addTagsObject:(NSManagedObject *)value;
- (void)removeTagsObject:(NSManagedObject *)value;
- (void)addTags:(NSSet *)values;
- (void)removeTags:(NSSet *)values;

@end
22 changes: 22 additions & 0 deletions FlickrExplorer/Core Data/Photo.m
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// Photo.m
// FlickrExplorer
//
// Created by admin on 4/M/13.
// Copyright (c) 2013 ThoughtAdvances. All rights reserved.
//

#import "Photo.h"


@implementation Photo

@dynamic title;
@dynamic unique;
@dynamic latitude;
@dynamic longitude;
@dynamic subtitle;
@dynamic place;
@dynamic tags;

@end
21 changes: 21 additions & 0 deletions FlickrExplorer/Core Data/Place.h
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// Place.h
// FlickrExplorer
//
// Created by admin on 4/M/13.
// Copyright (c) 2013 ThoughtAdvances. All rights reserved.
//

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

@class Photo, Vacation;

@interface Place : NSManagedObject

@property (nonatomic, retain) NSString * city;
@property (nonatomic, retain) NSString * country;
@property (nonatomic, retain) Vacation *vacation;
@property (nonatomic, retain) Photo *photos;

@end
21 changes: 21 additions & 0 deletions FlickrExplorer/Core Data/Place.m
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// Place.m
// FlickrExplorer
//
// Created by admin on 4/M/13.
// Copyright (c) 2013 ThoughtAdvances. All rights reserved.
//

#import "Place.h"
#import "Photo.h"
#import "Vacation.h"


@implementation Place

@dynamic city;
@dynamic country;
@dynamic vacation;
@dynamic photos;

@end
19 changes: 19 additions & 0 deletions FlickrExplorer/Core Data/Tag.h
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// Tag.h
// FlickrExplorer
//
// Created by admin on 4/M/13.
// Copyright (c) 2013 ThoughtAdvances. All rights reserved.
//

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

@class Photo;

@interface Tag : NSManagedObject

@property (nonatomic, retain) NSString * value;
@property (nonatomic, retain) Photo *photo;

@end
18 changes: 18 additions & 0 deletions FlickrExplorer/Core Data/Tag.m
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// Tag.m
// FlickrExplorer
//
// Created by admin on 4/M/13.
// Copyright (c) 2013 ThoughtAdvances. All rights reserved.
//

#import "Tag.h"
#import "Photo.h"


@implementation Tag

@dynamic value;
@dynamic photo;

@end
26 changes: 26 additions & 0 deletions FlickrExplorer/Core Data/Vacation.h
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// Vacation.h
// FlickrExplorer
//
// Created by admin on 4/M/13.
// Copyright (c) 2013 ThoughtAdvances. All rights reserved.
//

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


@interface Vacation : NSManagedObject

@property (nonatomic, retain) NSString * name;
@property (nonatomic, retain) NSSet *places;
@end

@interface Vacation (CoreDataGeneratedAccessors)

- (void)addPlacesObject:(NSManagedObject *)value;
- (void)removePlacesObject:(NSManagedObject *)value;
- (void)addPlaces:(NSSet *)values;
- (void)removePlaces:(NSSet *)values;

@end
17 changes: 17 additions & 0 deletions FlickrExplorer/Core Data/Vacation.m
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// Vacation.m
// FlickrExplorer
//
// Created by admin on 4/M/13.
// Copyright (c) 2013 ThoughtAdvances. All rights reserved.
//

#import "Vacation.h"


@implementation Vacation

@dynamic name;
@dynamic places;

@end

0 comments on commit 2b45c4c

Please sign in to comment.