위임 나는이 오류를인식 할 수없는 선택, 문제
무엇입니까 [ResultViewController setSearchFields을 : IndexPath을 :] : 인식 할 수없는 선택기 내가 사용하고있는 네비게이션 컨트롤러의 스택을 가지고 예를 0xc448840
로 전송 델리게이트는 네비게이션 스택의 이전 뷰로 정보를 다시 전달합니다. 그러나 델리게이트를 선언 할 때 내가 뭔가 잘못하고 있다고 생각합니다.
내 탐색 스택은 다음과 같습니다. 내가보기에보기 3 대리자를 설정해야하는 경우 ... 궁금 오전 내가 뷰 1을 터지는 나는이 오류가 무엇입니까 그렇게함으로써 그러나 그보기로 위임 정보를 전달하고있는 중이 야
view 0 (mainmenu)
-- view 1 (SearchViewController)
--- view 2 (ResultViewController) - where I set the delegate of the new view being loaded
---- View 3 (SubViewController) - this is where my delegates reside
1 어디에 내가 정보를 전달 결국 ... 그게 맞지 ??
그렇다면 델리게이트를 설정할 때 무엇을 생각해야합니까? 내가
SubViewController
내 대리자를 설정하고있어 어떻게 subvc.m@protocol PassSubSearchData <NSObject>
@required
- (void) setSearchFields:(NSArray *)modArray IndexPath:(NSIndexPath *)modIndexPath;
@end
@interface VehicleSubResultViewController : UITableViewController <NSXMLParserDelegate> {
//..
//Delegate for passing Mod and SubMod data back to VehicleSearchViewController
id <PassSubSearchData> delegate;
//..
//Delegate for passing Mod and SubMod data back to VehicleSearchViewController
@property (strong) id delegate;
subvc.h 이것은보기 1
를 호출 어떻게
#pragma mark - Table view delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
//Access selected cells content (cell.textLabel.text)
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
//Predicates restrict the values that will be returned from the query.
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%K like %@",@"SUB",cell.textLabel.text];
filterArray = [parsedDataArrayOfDictionaries filteredArrayUsingPredicate:predicate];
[[self delegate] setSearchFields:tempModArray IndexPath:tempModIndexPath];
//This pops to the View 1 - SearchViewController
[self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:1] animated:YES];
}
다음 내 SearchViewController에서 이것은 위임 항목을 설정하는 방법입니다.
searchvc.h
#import "SubViewController.h"
@interface SearchViewController : UITableViewController <PassSubSearchData> {
//..
searchvc.m
- (void) setSearchFields:(NSArray *)modArray IndexPath:(NSIndexPath *)modIndexPath
{
modSearchObjectString = [[modArray valueForKey:@"MOD"] objectAtIndex:0];
modSearchIndexPath = modIndexPath; // Sets the selected IndexPath from the subview
NSLog(@"%@", modSearchObjectString);
NSLog(@"%@", modResultIndexPath);
[self.tableView reloadData];
}
그 지연 죄송 거의 요약 그것을 ....
문제의 메서드 선언 및 메서드를 호출하는 코드를 사용하여 코드를 게시 할 수 있습니까? –
예. 지금하고 있습니다. –
나는 네가하고 싶은 일에 대해서 조금 불명확하다. 당신이 정말로 필요로하는 유일한 것은 테이블 뷰에서 다음 View Controller로 데이터를 전달하는 것입니다. PopUp이 말했습니다. –