开发者

Access another methods sender

So I'm pretty new to Objective-C and kind of just learning as I go here. So I have a method that passes on its sender when called to another method. So when called internally I can call 开发者_如何学Cit like this:

[self insertNewDBInfoConnection:sender];

Here's where I hit a bump in the road. this insertNewDBInfoConnection: is only going to be called when the user selects an option in an alert view which is set up like so:

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
    if([alertView.title isEqualToString:@"Would you like to save?"]) {
            switch(buttonIndex) {
                    case 0:
                            [self insertNewDBInfoConnection:sender];
                            [self dismissModalViewControllerAnimated:YES];
                            [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];

                            break;

                    case 1:
                            [self dismissModalViewControllerAnimated:YES];

                            break;
            }
    }

}

So ofcourse I can't just call [self insertNewDBInfoConnection:sender]; anymore because it doesn't know what sender is. So how to do I again access that methods sender externally here. A very simple solution I'm sure, but again, learning as I go.

Thanks in advance.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜