Sock.IO上传AppStore出现non-public selectors in payload...:decoder问题。

2014-11-23 23:30:10 · 作者: · 浏览: 7
假如你的工程使用了Socket.IO,用Application Loader上传工程可能会有上述提示,
在XCode中搜索整个工程,发现Socket.IO中存在decoder方法且是在NSObject分类器中创建,为了避免这个警告,修改很简单,只需在把此方法重命名即可。
修改前:
#import "SocketIOJSONSerialization.h"  
  
extern NSString * const SocketIOException;  
  
// covers the methods in SBJson and JSONKit  
@interface NSObject (SocketIOJSONSerialization)  
  
// used by both JSONKit and SBJson  
- (id) objectWithData:(NSData *)data;  
  
// Use by JSONKit serialization  
- (NSString *) JSONString;  
- (id) decoder;  
  
// Used by SBJsonWriter  
- (NSString *) stringWithObject:(id)object;  
  
@end  

修改后:
#import "SocketIOJSONSerialization.h"  
  
extern NSString * const SocketIOException;  
  
// covers the methods in SBJson and JSONKit  
@interface NSObject (SocketIOJSONSerialization)  
  
// used by both JSONKit and SBJson  
- (id) objectWithData:(NSData *)data;  
  
// Use by JSONKit serialization  
- (NSString *) JSONString;  
- (id) jsonDecoder;  
  
// Used by SBJsonWriter  
- (NSString *) stringWithObject:(id)object;  
  
@end  

因此,为避免苹果审核出现问题(non-public selectors in payload...),尽量在命名方法时候不要使用单个“单词”且该词过于敏感(未来可能会被苹果使用)的方式命名。