Wednesday, 15 January 2014

ios - Error: implementing a method which will also be implemented by its primary class -



ios - Error: implementing a method which will also be implemented by its primary class -

this coding error part app

- (id)initwithdata:(nsdata *)data <-------- options:(nsuinteger)options error:(nserror **)error { homecoming [self initwithdata:data content:xmldocument options:options error:error

but on first line comes 'category implementing method implemented primary class'. mean , how prepare it.

category in obj-c supposed add together methods base of operations class. not replace existing functionality. can't declare there methods same signature exist.

if want override existing method (initwithdata:...), should utilize inheritance, don't need category. if not - alter method name, allow instance:

- (id)initwithxmldata:(nsdata *)data options:(nsuinteger)options error:(nserror **)error

ios objective-c

No comments:

Post a Comment