這是我的核心數據的GeneratedCode,由xCode Editor自動生成。核心數據中的許多關係
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
@class Building, Category, City, District, Image, LatitudeLongitude, OpeningHour, Promotion, Rating, Review, URL;
@interface Business : NSManagedObject {
@private
}
@property (nonatomic, retain) NSString * Website;
@property (nonatomic, retain) NSString * Email;
@property (nonatomic, retain) NSString * Street;
@property (nonatomic, retain) NSString * InBuildingAddress;
@property (nonatomic, retain) NSString * Phone;
@property (nonatomic, retain) NSString * Title;
@property (nonatomic, retain) NSString * Zip;
@property (nonatomic, retain) NSNumber * Price;
@property (nonatomic, retain) NSSet* Promotions;
@property (nonatomic, retain) Building * Building;
@property (nonatomic, retain) NSSet* Categories;
@property (nonatomic, retain) LatitudeLongitude * LatitudeLongitude;
@property (nonatomic, retain) NSSet* Images;
@property (nonatomic, retain) OpeningHour * OpeningHour;
@property (nonatomic, retain) NSSet* Reviews;
@property (nonatomic, retain) NSSet* URLs;
@property (nonatomic, retain) Rating * Rating;
@property (nonatomic, retain) NSSet* Districts;
@property (nonatomic, retain) City * City;
//我加了這3行,爲什麼不自動生成代碼的一部分?
- (void)addDistrictsObject:(District *)value;
- (void)addCategoriesObject:(Category *)value;
- (void)addReviewsObject:(Review *)value;
@end
說我想「清除」所有評論和圖像。
Will doing self.Reviews = nil do the trick?
我知道做self.LitudeitudeLongitude = nil會刪除自己和它的LatitutudeLongitude之間的關係。