0
FirstViewController.h如何在2個不同文件之間調用/鏈接IBAction?
#import "EditLocation.h"
FirstViewController.m
@synthesize currentLocationLabel;
- (IBAction) updateCurrentLocationLabel:(NSString *) location {
NSLog(@"CLICK");
currentLocationLabel.text = [NSString stringWithFormat:@"%@", location];
}
EditLocation.h
#import "FirstViewController.h"
EditLocation.m
- (void)alertView:(UIAlertView *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 0)
{
[self.navigationController updateCurrentLocationLabel: location];
[self.navigationController popViewControllerAnimated:YES];
}
}
您好,使用導航控制器+標籤欄控制器應用程序
IM。它能夠從PageB(EditLocation)返回到PageA(FirstViewCOntroller),當用戶選項卡Ok時,PageB上有一個UIAlert,它將返回到PageA,其中標籤(位置)將使用從位置對象獲取的地址更新。
但是,有一個錯誤,並導致我的程序崩潰。
這裏是在控制檯中顯示的問題:
2011-08-03 01:33:23.276 Tab Bar Application[5087:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UINavigationController updateCurrentLocationLabel:]: unrecognized selector sent to instance 0x5a37b70'
請幫我解決這個問題! 在此先感謝!我仍然是目標C中的新手,因此我選擇了使用的單詞和語言。
好的,但信息存儲在EditLocation.m,我試圖將信息移動到FirstViewController.m中找到的標籤。 *旁註,你知道在哪裏可以找到searchMap的教程嗎? – Jovi