iosobjective-cacaccount

ACAccount Unrecognized selector sent to instance(NSInvalidArgumentException)


I select one of the existing accounts. I want to pass another viewController this selected account. But i get this error --> "Unrecognized selector sent to instance"

Here my code:

select account on tableView:

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    AccountsTableViewCell *selectedRow = [self.accountTable cellForRowAtIndexPath:indexPath];
    choosenAccount = selectedRow.twitAccount;
     [self performSegueWithIdentifier:@"selectAccount" sender: nil];

}

segue:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([segue.identifier isEqualToString:@"selectAccount"]) {
         TwitterFollowersViewController *vc = (TwitterFollowersViewController *) segue.destinationViewController;
        vc.twitterAccount = choosenAccount;
    }
}

ViewController.h file:

@interface TwitterFollowersViewController : UIViewController
      @property (retain, nonatomic) ACAccount *twitterAccount;
@end

LOG:

2014-05-10 23:54:13.297 tweet++[10143:60b] -[UIViewController setTwitterAccount:]: unrecognized selector sent to instance 0xa45d870
2014-05-10 23:54:13.300 tweet++[10143:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController setTwitterAccount:]: unrecognized selector sent to instance 0xa45d870'
*** First throw call stack:
(
    0   CoreFoundation                      0x0194e1e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x016cd8e5 objc_exception_throw + 44
    2   CoreFoundation                      0x019eb243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
    3   CoreFoundation                      0x0193e50b ___forwarding___ + 1019
    4   CoreFoundation                      0x0193e0ee _CF_forwarding_prep_0 + 14
    5   tweet++                             0x000071ac -[TwitterAccountsViewController prepareForSegue:sender:] + 268
    6   UIKit                               0x008f1efa -[UIStoryboardSegueTemplate _perform:] + 156
    7   UIKit                               0x004ae41c -[UIViewController performSegueWithIdentifier:sender:] + 72
    8   UIKit                               0x0f20f8fc -[UIViewControllerAccessibility(SafeCategory) performSegueWithIdentifier:sender:] + 63
    9   tweet++                             0x00006fff -[TwitterAccountsViewController tableView:didSelectRowAtIndexPath:] + 287
    10  UIKit                               0x004779a1 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1513
    11  UIKit                               0x00477b14 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 279
    12  UIKit                               0x0047c10e __38-[UITableView touchesEnded:withEvent:]_block_invoke + 43
    13  UIKit                               0x003ab0aa ___afterCACommitHandler_block_invoke + 15
    14  UIKit                               0x003ab055 _applyBlockToCFArrayCopiedToStack + 403
    15  UIKit                               0x003aae76 _afterCACommitHandler + 532
    16  CoreFoundation                      0x0191636e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
    17  CoreFoundation                      0x019162bf __CFRunLoopDoObservers + 399
    18  CoreFoundation                      0x018f4254 __CFRunLoopRun + 1076
    19  CoreFoundation                      0x018f39d3 CFRunLoopRunSpecific + 467
    20  CoreFoundation                      0x018f37eb CFRunLoopRunInMode + 123
    21  GraphicsServices                    0x01bab5ee GSEventRunModal + 192
    22  GraphicsServices                    0x01bab42b GSEventRun + 104
    23  UIKit                               0x0038df9b UIApplicationMain + 1225
    24  tweet++                             0x000076ad main + 141
    25  libdyld.dylib                       0x04fdc701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Solution

  • Check the class name in the storyboard, I think its UIViewController rather then TwitterFollowersViewController.