ios - DetailViewController 上的 Apple Mach-O 链接器错误

标签 ios objective-c

我添加了一个 View Controller ,它是表格的详细 View ,我不断收到 Apple Mach-O 链接器错误,但我似乎无法弄清楚原因。
这是我的 .h 文件:

#import <UIKit/UIKit.h>
#import "EmailCell.h"
#import "MasterViewController.h"

@interface DetailViewController : MasterViewController <UITableViewDataSource, UITableViewDelegate,         ZKRevealingTableViewCellDelegate, UIAlertViewDelegate> {
NSDictionary *newsArticle;

IBOutlet UILabel *titleLabel;
IBOutlet UILabel *timeLabel;
IBOutlet UITextView *descTextView;



}

@property (nonatomic, copy) NSDictionary *newsArticle;

@property (strong, nonatomic) IBOutlet UIButton *callHotline;
@property (strong, nonatomic) IBOutlet UIBarButtonItem *postToTwitter;

@property (strong, nonatomic) IBOutlet UITableView *tableView;

@end

和我的 .m 文件:
#import "ADVTheme.h"
#import "DataSource.h"
#import "AppDelegate.h"
#import "DetailViewController.h"
#import <QuartzCore/QuartzCore.h>
#import "Utils.h"
#import "Social/Social.h"
#import "Flurry.h"


@interface DetailViewController () {
NSIndexPath *currentIndex;
}

 @property (strong, nonatomic) NSArray *items;
 @property (strong, nonatomic) ZKRevealingTableViewCell *currentlyRevealedCell;

@end




 @implementation DetailViewController
 @synthesize newsArticle;

 #pragma mark - View lifecycle

 - (void)viewDidLoad {
[super viewDidLoad];

if(![Utils isVersion6AndBelow])
    self.navigationController.navigationBar.translucent = NO;

 [ADVThemeManager customizeView:self.view];


UILabel *titleLabel = [[UILabel alloc] init];

titleLabel.text = [newsArticle objectForKey:@"title"];
timeLabel.text = [newsArticle objectForKey:@"date_string"];

descTextView.text = [newsArticle objectForKey:@"article"];



titleLabel.text = @"AEVIDUM";
titleLabel.textColor = [UIColor whiteColor];
titleLabel.backgroundColor = [UIColor clearColor];
titleLabel.font = [UIFont fontWithName:@"ProximaNova-Bold" size:17];
[titleLabel sizeToFit];
self.navigationItem.titleView = titleLabel;



 if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
    if ([[NSUserDefaults standardUserDefaults] integerForKey:@"NavigationType"] ==     ADVNavigationTypeMenu) {
        UIButton *menuButton = [UIButton buttonWithType:UIButtonTypeCustom];
        menuButton.frame = CGRectMake(0, 0, 40, 30);
        [menuButton setImage:[UIImage imageNamed:@"navigation-btn-menu"] forState:UIControlStateNormal];
        [menuButton addTarget:self action:@selector(showMenu:) forControlEvents:UIControlEventTouchUpInside];
        self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:menuButton];
    } else {
        self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 5)];
    }
}


self.tableView.tableHeaderView.backgroundColor = [UIColor colorWithRed:0.27f green:0.29f blue:0.31f alpha:1.00f];

NSString *filterTitle = [NSString stringWithFormat:@"Showing %@ of %@", @10, @52];
UILabel *labelFilter = (UILabel *)[self.tableView.tableHeaderView viewWithTag:1];

const CGFloat fontSize = 14;
UIFont *boldFont = [UIFont fontWithName:@"ProximaNova-Semibold" size:fontSize];
UIFont *regularFont = [UIFont fontWithName:@"ProximaNova-Regular" size:fontSize];
UIColor *regularColor = [UIColor whiteColor];
UIColor *boldColor = [UIColor whiteColor];
NSDictionary *attrs = [NSDictionary dictionaryWithObjectsAndKeys:
                       regularFont, NSFontAttributeName,
                       regularColor, NSForegroundColorAttributeName, nil];
NSDictionary *subAttrs = [NSDictionary dictionaryWithObjectsAndKeys:
                          boldFont, NSFontAttributeName,
                          boldColor, NSForegroundColorAttributeName, nil];
const NSRange range = NSMakeRange(8, 2);

// Create the attributed string (text + attributes)
NSMutableAttributedString *attributedText =
[[NSMutableAttributedString alloc] initWithString:filterTitle
                                       attributes:attrs];
[attributedText setAttributes:subAttrs range:range];

const NSRange range1 = NSMakeRange(13, 3);
[attributedText setAttributes:subAttrs range:range1];

[labelFilter setAttributedText:attributedText];

UIButton *btnFilter = (UIButton *)[self.tableView.tableHeaderView viewWithTag:2];
btnFilter.layer.cornerRadius = 2;
btnFilter.titleLabel.font = [UIFont fontWithName:@"ProximaNova-Bold" size:10];
btnFilter.backgroundColor = [UIColor colorWithRed:0.17f green:0.18f blue:0.20f alpha:1.00f];


 }

 - (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];

self.items = [DataSource timeline];
[self.tableView reloadData];
 }

 - (void)viewDidUnload {
[super viewDidUnload];

 }


 #pragma mark - Actions

 - (void)showMenu:(id)sender {
[[AppDelegate sharedDelegate] togglePaperFold:sender];
 }






#pragma mark - UITableView datasource

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
 }

 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.items.count;
 }

 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath      *)indexPath {
NSString *CellIdentifier = @"StoreCell";
EmailCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];


NSDictionary *item = self.items[indexPath.row];
cell.data = item;

cell.delegate       = self;
cell.backView.frame = CGRectMake(0, 0, 190, [self tableView:_tableView      heightForRowAtIndexPath:nil]);
cell.backView.backgroundColor = [UIColor colorWithRed:0.91f green:0.38f blue:0.39f alpha:1.00f];
cell.direction = ZKRevealingTableViewCellDirectionRight;

for(UIView *cellItem in cell.backView.subviews) {
    [cellItem removeFromSuperview];
 }


 return cell;
 }

 #pragma mark - Table view delegate

 - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 79;
 }

 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {    
[tableView deselectRowAtIndexPath:indexPath animated:YES];

currentIndex = indexPath;
[self performSegueWithIdentifier:@"showDetail" sender:self];
 }

 #pragma mark - ZKRevealingTableViewCellDelegate

 - (BOOL)cellShouldReveal:(ZKRevealingTableViewCell *)cell {
return YES;
 }

 - (void)cellDidReveal:(EmailCell *)cell {
NSLog(@"Revealed Cell with name: %@", cell.lblTitle.text);
self.currentlyRevealedCell = cell;
 }

 - (void)cellDidBeginPan:(ZKRevealingTableViewCell *)cell {
if (cell != self.currentlyRevealedCell)
    self.currentlyRevealedCell = nil;
 }


 #pragma mark - Segue


 //Action Button
 - (IBAction)postToTwitter:(id)sender {
 UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Actions" message:@""
                                               delegate:self cancelButtonTitle:@"Close"
                                      otherButtonTitles:@"Tweet #Aevidum", @"Call National      Helpline", @"Contact Aevidum", nil];
[alert show];

 }

 - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
 {
 if (buttonIndex == 0)
 {
    //Neither


}
if (buttonIndex == 1)
{
    //Tweet
    if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
    {
        SLComposeViewController *tweetSheet = [SLComposeViewController
                                                composeViewControllerForServiceType:SLServiceTypeTwitter];
        [tweetSheet setInitialText:@"#aevidum"];
        [self presentViewController:tweetSheet animated:YES completion:nil];
       [Flurry logEvent:@"User Launched Tweet Sheet On Detail VC"];
    }

}
if (buttonIndex == 2)
{

    //Call
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:18002738255"]];
   [Flurry logEvent:@"User Called Hotline On Detail VC"];
}
if (buttonIndex == 3)
{
    //Contact

    NSURL* mailURL = [NSURL URLWithString: @"mailto:bporter@aevidum.org?&subject=Aevidum%20App%20Contact&body="];
    [[UIApplication sharedApplication] openURL: mailURL];
    [Flurry logEvent:@"User Tapped Contact Aevidum On Detail VC"];


}
 }

 @end

任何帮助将不胜感激。

更新:
这是我的错误信息:
ld: warning: directory not found for option '-L/Users/Ben/Documents/AevidumApp/flattened-d/sample-project/Flattened/Flurry'
ld: warning: directory not found for option '-LiPhone'
ld: warning: directory not found for option '-LSDK'
ld: warning: directory not found for option '-LviPhone'
ld: warning: directory not found for option '-L5.4.0/Flurry-iOS-5.4.0/Flurry'
duplicate symbol _OBJC_CLASS_$_DetailViewController in:
    /Users/Ben/Library/Developer/Xcode/DerivedData/Aevidum-bwoaadpgrdrtbldbecytkhjhqxhb/Build/Intermediates/Aevidum.build/Debug-iphonesimulator/Aevidum.build/Objects-normal/x86_64/DetailViewController-1A6DD9FBD478005A.o
    /Users/Ben/Library/Developer/Xcode/DerivedData/Aevidum-bwoaadpgrdrtbldbecytkhjhqxhb/Build/Intermediates/Aevidum.build/Debug-iphonesimulator/Aevidum.build/Objects-normal/x86_64/DetailViewController-ABC328ACC6891270.o
duplicate symbol _OBJC_METACLASS_$_DetailViewController in:
    /Users/Ben/Library/Developer/Xcode/DerivedData/Aevidum-bwoaadpgrdrtbldbecytkhjhqxhb/Build/Intermediates/Aevidum.build/Debug-iphonesimulator/Aevidum.build/Objects-normal/x86_64/DetailViewController-1A6DD9FBD478005A.o
    /Users/Ben/Library/Developer/Xcode/DerivedData/Aevidum-bwoaadpgrdrtbldbecytkhjhqxhb/Build/Intermediates/Aevidum.build/Debug-iphonesimulator/Aevidum.build/Objects-normal/x86_64/DetailViewController-ABC328ACC6891270.o
ld: 2 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

最佳答案

我的项目中有另一个名为 Detail View Controller 的文件引发了错误。

关于ios - DetailViewController 上的 Apple Mach-O 链接器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26878131/

相关文章:

ios - 如何在 Swift 中访问 UIColor 的扩展?

ios - Apples SinglePing 应用程序不调用委托(delegate)方法

ios - 尝试一次执行多个动画

objective-c - 异步 NSURLConnection 与 NSOperation

objective-c - 如何将 NSInteger 转换为 int?

ios - 使用_框架!在 cocoapods 中进行分析

ios - 具有关系的 NSManagedObject 的核心数据和生成的子类

ios - 找不到框架头文件(iOS pop 框架)

objective-c - 如何修改 CNLabeledValue 的值,保持标识符不变

ios - SpriteKit - 多个对象的接触检测