Я пытаюсь передать некоторые данные обратно в мой UIView, его абзац сложной ситуации я попытаюсь объяснить.протокол и метод делегирования недоступен
У меня есть мой
mainViewController // request is made to RequestClass
requestClass // Request is sent off to DB for data, data is returned then passed to seriesDataClass
seriesDataClass // sorts the data and then sends back the needed info to mainViewController using protocol & delegates
Это то, что мой код выглядит для настройки протоколов и делегатов
mainViewController.h
#import "SeriesDataClass.h"
@interface MatchingSeriesViewController : UIViewController <GetSeriesViewParsedData>
{
mainViewController.m
#import "SeriesDataClass.h"
// this is where I set up my protocols delegate.
- (void)viewDidLoad
{
//..
// get delegate ready
SeriesDataClass *seriesDataClass = [[SeriesDataClass alloc] init];
[seriesDataClass setDelegate:self];
//..
// pass data over to requestClass so you can get the info from the DB
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
//..
[requestClass GetSeries:requestID];
//..
}
requestClass.m
// dose a bunch of stuff then calls seriesDataClass and passes all of its information over to it
//..
SeriesDataClass *seriesDataClass = [[SeriesDataClass alloc] init];
[seriesDataClass recivedData:uncompressedData];
//..
seriesDataClass.h
#import <Foundation/Foundation.h>
// This passes data back to the mainViewController
@protocol GetSeriesViewParsedData <NSObject>
- (void)sendGetSeriesArrays:(NSDictionary *)series LSeries:(NSDictionary *)lSeries;
@end
@interface SeriesDataClass : NSObject <NSXMLParserDelegate> {
//..
}
@property (assign, nonatomic) id <GetSeriesViewParsedData> delegate;
seriesDataClass.m
@implementation SeriesDataClass
@synthesize delegate;
// then in a method later on i call the delegate to pass the information back to mainViewController but this dosnt do anything atm.
//..
[self.delegate sendGetSeriesArrays:seriesDictionary LSeries:lSeriesDictionary];
//..
mainViewController.m
// then back in the mainViewController class I Have the method
- (void)sendGetSeriesArrays:(NSDictionary *)series LSeries:(NSDictionary *)lSeries {
// this method is never accessed
}
Так что мой вопрос, что мне не хватает в наборе до этого протокола/delgate для этого не будет правильно работать?
Надеюсь, что структура вопроса имеет смысл, если вам нужна дополнительная информация, пожалуйста, дайте мне знать.
, есть ли у вас какие-либо подсказки о том, как это сделать. Я даже не знаю, что искать в google, который находится на тех же строках, что и проблема, которую я испытываю. – HurkNburkS
@HurkNburkS, см. Мое редактирование. – rdelmar
okay cool будет читать его медленно, а затем попытаться реализовать его, я мог бы быть 15 минут: P Спасибо за редактирование: P – HurkNburkS