Confusión acerca de agregar NSCoding a un proyecto existente (nuevo en C)

I was reading a tutorial

http://www.raywenderlich.com/1914/how-to-save-your-app-data-with-nscoding-and-nsfilemanager

about using NSCoding so that I can save my app data. Early on the tutorial modified the @interface line to look like this:

@interface ScaryBugData : NSObject <NSCoding>

My intent is to use NSCoding in my Delegate, but the @interface line already looks like this:

@interface MyAppDelegate : UIResponder <UIApplicationDelegate>
...
@end

Since I'm new to objective-c, I'm not sure how to combine the two in the same .h file. (For that matter, I'm not clear on the syntax either.)

How would I combine and use the two statements?

preguntado el 01 de febrero de 12 a las 14:02

2 Respuestas

If an class conforms to more than one protocol, you can list them commaseperated like

<UIApplicationDelegate, NSCoding>

Respondido 01 Feb 12, 18:02

this has nothing to do with delegates. has more than one delegate probably mean conforms to more than one protocol. - usuario971401

@interface MyAppDelegate : UIResponder <UIApplicationDelegate, NSCoding> {...} ... @end

should do what you want, I think.

Respondido 01 Feb 12, 18:02

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.