导入 .h 会导致重复符号崩溃 iOS
Importing .h causes Duplicate Symbol Crash iOS
我试图在我的 iOS 应用程序中将字符串从一个 Class 传递到另一个。我是这样设置的:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// open a alert with an OK and cancel button
Vimeo *vimeo= [[[Vimeo alloc] initWithNibName:@"Vimeo" bundle:[NSBundle mainBundle]] autorelease];
[self.navigationController pushViewController:vimeo animated:YES];
UITableViewCell *selectedCell = [tableView cellForRowAtIndexPath:indexPath];
vimeo.feedAddress = selectedCell.textLabel.text;
}
如果我不这样做
#import "Vimeo.h"
在执行这个 class 时,我得到一个错误,它无法在 Vimeo 中找到 属性 feedAddress。如果我导入它,该错误就会消失,但在运行时,我会收到重复符号错误。
这是怎么回事?
确保您的项目中没有两个名为 Vimeo.h 的文件,或者您没有 class Vimeo
的两个声明
我试图在我的 iOS 应用程序中将字符串从一个 Class 传递到另一个。我是这样设置的:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// open a alert with an OK and cancel button
Vimeo *vimeo= [[[Vimeo alloc] initWithNibName:@"Vimeo" bundle:[NSBundle mainBundle]] autorelease];
[self.navigationController pushViewController:vimeo animated:YES];
UITableViewCell *selectedCell = [tableView cellForRowAtIndexPath:indexPath];
vimeo.feedAddress = selectedCell.textLabel.text;
}
如果我不这样做
#import "Vimeo.h"
在执行这个 class 时,我得到一个错误,它无法在 Vimeo 中找到 属性 feedAddress。如果我导入它,该错误就会消失,但在运行时,我会收到重复符号错误。
这是怎么回事?
确保您的项目中没有两个名为 Vimeo.h 的文件,或者您没有 class Vimeo
的两个声明