Currently I'm working on an iOS application in which I am using delegates and I have implemented something like this:
@protocol Hello & lt; NSObject & gt; @required - (zero) Update: (NSDIP * *) data; @end @Intefus notificationHandler: NSObase {id & lt; Hello & gt; Representative; } - Send (zero) data; @end When there is a specific notification, it will call the sendData method and call it update to call Will delegate . Everything is working fine In the dictionary, I have to pass specific values for some special representatives. That's why I'm importing such headers:
#import "special1.h" #import "special 2. h" - (zero) Send data {if ([_ Rep isKindOfClass: [Special 1 class]]) {// Special Class 1 NSDrrigation * begin with dict = // parameters and values [(Special 1 *) _ Representative Update: dict]; } And if ([_ Rep, KindOfClass: [Special 2 squares]]) {// Special Class 2 NSDictionary * dict = // start with values and values [(Special 2 *) _ Representative Update: dict]; }} The point here is, I have to import all the special classes here. Is any class to do this without importing it?
I found a solution using this type:
- (Void) sendData {if you want to get started with {if you want to delete the message, click here.} {Select_digit = "special" Object with: dict]; } Else if ([_ Rep isKindOfClass: NSClassFromString (@ "Special2")) {// Special Class 2 Start with NSDictionary * dict = // parameters and values [_delegate performSelector: @selector (Update :) withObject: dict ]; }}
No comments:
Post a Comment