KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a connection class in my project. I want to use this class in for a lot of works. When I tried to call this class's function getting following error : No visible @interface declares the selector error coreConnection.h @interface coreConnection:NSArray { NSData *returnData; } -(NSArray*)getData; @end coreConnection.m #import "coreConnection.h" @implementation coreConnection -(NSArray*)getData:(NSString*)link { NSOperationQueue *apiCallsQueue = [[NSOperationQueue alloc] init]; NSURL *URL = [NSURL URLWithString:link]; NSURLRequest *request = [NSURLRequest requestWithURL:URL]; [NSURLConnection sendAsynchronousRequest:request queue:apiCallsQueue completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) { dispatch_async(dispatch_get_main_queue(), ^{ returnData = data; }); }]; return [NSJSONSerialization JSONObjectWithData:returnData options:nil error:nil]; } @end viewController.m #import "coreConnection.h" - (void)viewDidLoad { [[self headlineCollectionView]setDelegate:self]; [[self headlineCollectionView]setDataSource:self]; [self.headlineCollectionView registerNib:[UINib nibWithNibName:@"HeadLineCell" bundle:nil] forCellWithReuseIdentifier:@"CELL"]; coreConnection speed=[[coreConnection alloc] init];; headline = [speed getData:@"string"]; [self.headlineCollectionView reloadData]; [super viewDidLoad]; }
Tags (comma-separated)
Save Edits
Cancel