0

While validating my ios app with apple store, I am getting following error:

"The app references non-public selectors in Payload appname.app/appname: AddAssetObject"

In my project AddAssetObject is a selector in a CoreData entity class. I called it from one of my class to save some data:

@interface Students : NSManagedObject

@property (nonatomic, retain) NSString * firstname;
@property (nonatomic, retain) NSString * surname;
@property (nonatomic, retain) NSSet *assets;
@end

@interface Students (CoreDataGeneratedAccessors)

- (void)addAssetsObject:(Evidence *)value;
- (void)removeAssetsObject:(Evidence *)value;
- (void)addAssets:(NSSet *)values;
- (void)removeAssets:(NSSet *)values;

@end

I called addAssetObject in one of my code:

[self.student addAssetsObject:self.evidence];

However, I am not sure if this is illegal and generating the issue. Any idea or help?

Pixelord
  • 621
  • 9
  • 24
  • possible duplicate of [The app references non-public selectors in Payload/.app/: decoder](http://stackoverflow.com/questions/19378484/the-app-references-non-public-selectors-in-payload-appname-app-app-name-dec) – Lorenzo B Jan 16 '14 at 17:30
  • You can find private methods in Apple frameworks in iOS-Runtime-Headers project: https://github.com/nst/iOS-Runtime-Headers/blob/e6eb5f69b3a744b151e8e4a2f27cb1ce129b7812/PrivateFrameworks/PhotoLibraryServices.framework/PLMoment.h – Michał Ciuba Jan 29 '15 at 18:59

2 Answers2

0

Try rename the method to something different than addAssetsObject. This error mostly appears if there are two selector with the same name. Maybe there is some Apple method or other private third part library with the same selector.

Greg
  • 25,317
  • 6
  • 53
  • 62
0

I had a property on my Entity called "assets" as well and CoreData generated the same addAssetsObject method for me and I got the same error. -addAssetsObject happens to also be a private, internal function that our entity relationships just happened to conflict with because of the name.

Just delete those method definitions in your .h and don't call them anywhere in your code. You can add your Asset object to Students object in a different manner.

I had a Player entity which had a one-to-many relationship with my Asset entity. The Asset entity had a one-to-one relationship back to the Player. So instead of calling [player addAssetsObject:asset] I just called asset.player = player; and the relationship was built just fine without calling any bad functions.

Kenny Wyland
  • 20,844
  • 26
  • 117
  • 229