现在我遇到的问题是我似乎无法将具体状态传递给init方法,我总是得到一个
implicit conversion of an objective-c pointer to __autoreleasing ID is disallowed with ARC
代码:
-(DAOObject *)makeSpecificdataAccessObject{ sqliteState* localstate = [[sqliteState alloc] initWithtablename:@"tablename"]; DAOObject* specificdaO = [[DAOObject alloc] initWithLocalState:localstate]; //where error happens return specificdaO;}@interface DAOObject : NSObject <SettingsListenerProtocol> -(ID)initWithLocalState:(ID<StateProtocol> *)LocalState;@end@interface sqliteState : NSObject <StateProtocol>-(ID)initWithtablename:(Nsstring *)tablename;@end解决方法 删除明星*
-(ID)initWithLocalState:(ID<StateProtocol> *)LocalState;
ID已被定义为指向类实例的指针.
总结以上是内存溢出为你收集整理的Objective-C将obj-c指针隐式转换为自动释放id错误全部内容,希望文章能够帮你解决Objective-C将obj-c指针隐式转换为自动释放id错误所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)