IOS delegation and data source

I learned about delegation and data sources for iOS programming and should ask if there are any differences that you need to make when you make the data source protocol than the delegate protocol?

Also, how can I implement a delegate for many of the same objects in one delegate? An example of a single object with many unique user alerts.

- Edit -

An example for the second part:

One object with four different alerts with different buttons. Because the object must determine how each button works as a delegate for alerts. How to set delegate methods to define each warning?

+5
source share
1 answer

, , , .

, . , UITableViewDelegate , didSelectRowAtIndexPath .

. , UITableViewDataSource , cellForRowAtIndexPath numberOfRowsInSection, , .

, , , , .

EDIT:

: , -, . , (, , , , ), , :

@interface SaveConfirmAlertDelegate : NSObject<UIAlertViewDelegate>
@end

@implementation SaveConfirmAlertDelegate , , .

, , , self. , .

I hope this clears things up.

+14
source

All Articles