I know there are a lot of these types of questions on stack, but none of the responses helped me, so here I am, stuck.
Dropbox links to images at bottom
I am getting an error when building my iOS xcode project. It says that there are duplicate symbols, but I cant seem to figure out why it is saying there is duplicates...
There are no duplicates in my build settings as you can see in my second screenshot.
I tried the options offered in this post and none worked: linker command failed with exit code 1 (use -v to see invocation)
The variables that the compiler is saying is duplicate are located in cellConstants.h, which I import into both DNZListCell.m and DNZTaskCell.m
Any help would be greatly appreciated.
Thank you!!
cellConstants.h
#ifndef Donzo_cellConstants_h
#define Donzo_cellConstants_h
const float UI_CUES_MARGIN = 10.0f;
const float UI_CUES_WIDTH = 50.0f;
const float LABEL_LEFT_MARGIN = 15.0f;
const float LABEL_WIDTH = 150.0f;
const float TASK_LABEL_WIDTH = 60.0f;
#endif
DNZListCell.h
#import <UIKit/UIKit.h>
#import "DNZList.h"
#import "DNZListTableViewCellDelegate.h"
@class DNZStrikethroughLabel;
@interface DNZListCell : UITableViewCell <UITextFieldDelegate>
// The item that this cell renders
@property (nonatomic) DNZList *listItem;
// The object that acts as delegate for this cell.
@property (nonatomic, assign) id<DNZListTableViewCellDelegate> delegate;
@end
DNZListCell.m
//
//  DNZListCell.m
//  Donzo
//
//  Created by Matt Wahlig on 2/22/13.
//  Copyright (c) 2013 Matt Wahlig. All rights reserved.
//
#import "DNZListCell.h"
#import <QuartzCore/QuartzCore.h>
#import "DNZStrikethroughLabel.h"
#import "DNZShowListSegue.h"
#import "cellConstants.h"
@implementation DNZListCell {
    CGPoint _originalCenter;
    BOOL _deleteOnDragRelease;
    DNZStrikethroughLabel *_label;
    UILabel *_taskCountLabel;
    UILabel *_crossLabel;
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        _label = [[DNZStrikethroughLabel alloc] initWithFrame:CGRectNull];
        _label.textColor = [UIColor whiteColor];
        _label.font = [UIFont fontWithName:@"nevis" size:28];
        _label.backgroundColor = [UIColor clearColor];
        _label.delegate = self;
        _label.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
        [self addSubview:_label];
        // remove the default blue highlight for selected cells
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        _taskCountLabel = [[UILabel alloc] initWithFrame:CGRectNull];
        _taskCountLabel.font = [UIFont fontWithName:@"nevis" size:26];
        [_taskCountLabel setTextAlignment:NSTextAlignmentCenter];
        [self addSubview:_taskCountLabel];
        _crossLabel = [self createCueLabel];
        _crossLabel.text = @"\uf00d";
        _crossLabel.textAlignment = NSTextAlignmentLeft;
        [self addSubview:_crossLabel];
        UIPanGestureRecognizer* recognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)];
        recognizer.delegate = self;
        [self addGestureRecognizer:recognizer];
        UITapGestureRecognizer *singleFingerTap =
        [[UITapGestureRecognizer alloc] initWithTarget:self
                                                action:@selector(handleSingleTap:)];
        [self addGestureRecognizer:singleFingerTap];
    }
    return self;
}
-(void)layoutSubviews {
    [super layoutSubviews];
    // ensure the gradient layers occupies the full bounds
    _label.frame = CGRectMake(LABEL_LEFT_MARGIN, 0,
                              self.bounds.size.width-LABEL_LEFT_MARGIN-TASK_LABEL_WIDTH,self.bounds.size.height);
    _taskCountLabel.frame = CGRectMake(LABEL_LEFT_MARGIN+_label.frame.size.width, 0, TASK_LABEL_WIDTH, TASK_LABEL_WIDTH);
    _crossLabel.frame = CGRectMake(self.bounds.size.width + UI_CUES_MARGIN, 0,
                                   UI_CUES_WIDTH, self.bounds.size.height);
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    // Configure the view for the selected state
}
-(void)setListItem:(DNZList *)listItem {
    _listItem = listItem;
    // we must update all the visual state associated with the model item
    _label.text = [listItem.listName uppercaseString];
    _taskCountLabel.text = [NSString stringWithFormat:@"%i",listItem.taskArray.count];
    _taskCountLabel.textColor = _listItem.listColorScheme.listBackgroundColor;
    _taskCountLabel.backgroundColor = _listItem.listColorScheme.toolbarBackgroundColor;
}
-(UILabel*) createCueLabel {
    UILabel* label = [[UILabel alloc] initWithFrame:CGRectNull];
    label.textColor = [UIColor whiteColor];
    label.font = [UIFont fontWithName:@"FontAwesome" size:28];
    label.backgroundColor = [UIColor clearColor];
    return label;
}
#pragma mark - single tap gesture methods
- (void)handleSingleTap:(UITapGestureRecognizer *)recognizer {
    [self.delegate listCellClicked:self];
}
#pragma mark - horizontal pan gesture methods
-(BOOL)gestureRecognizerShouldBegin:(UIPanGestureRecognizer *)gestureRecognizer {
    if([gestureRecognizer isKindOfClass:[UILongPressGestureRecognizer class]]) {
        return NO;
    }
    CGPoint translation = [gestureRecognizer translationInView:[self superview]];
    // Check for horizontal gesture
    if (fabsf(translation.x) > fabsf(translation.y)) {
        return YES;
    }
    return NO;
}
-(void)handlePan:(UIPanGestureRecognizer *)recognizer {
    // 1
    if (recognizer.state == UIGestureRecognizerStateBegan) {
        // if the gesture has just started, record the current centre location
        _originalCenter = self.center;
    }
    // 2
    if (recognizer.state == UIGestureRecognizerStateChanged) {
        // translate the center
        CGPoint translation = [recognizer translationInView:self];
        self.center = CGPointMake(_originalCenter.x + translation.x, _originalCenter.y);
        // determine whether the item has been dragged far enough to initiate a delete / complete
        _deleteOnDragRelease = self.frame.origin.x < -_crossLabel.frame.size.width; //-self.frame.size.width / 2;
        // fade the contextual cues
        float cueAlpha = fabsf(self.frame.origin.x) / _crossLabel.frame.size.width;//(self.frame.size.width / 2);
        _crossLabel.alpha = cueAlpha;
        // indicate when the item have been pulled far enough to invoke the given action
        _crossLabel.textColor = _deleteOnDragRelease ?
        [UIColor colorWithRed:242/255.0 green:108/255.0 blue:79/255.0 alpha:1] : [UIColor whiteColor];
    }
    // 3
    if (recognizer.state == UIGestureRecognizerStateEnded) {
        // the frame this cell would have had before being dragged
        CGRect originalFrame = CGRectMake(0, self.frame.origin.y,
                                          self.bounds.size.width, self.bounds.size.height);
        if (!_deleteOnDragRelease) {
            // if the item is not being deleted, snap back to the original location
            [UIView animateWithDuration:0.2
                             animations:^{
                                 self.frame = originalFrame;
                             }
             ];
        }
        if (_deleteOnDragRelease) {
            // notify the delegate that this item should be deleted
            [self.delegate listItemDeleted:self.listItem];
        }
    }
}
#pragma mark - UITextFieldDelegate
-(BOOL)textFieldShouldReturn:(UITextField *)textField {
    // close the keyboard on enter
    [textField resignFirstResponder];
    return NO;
}
//
//-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
//    // disable editing of completed to-do items
//    return !self.listItem.completed;
//}
-(void)textFieldDidBeginEditing:(UITextField *)textField {
    [self.delegate cellDidBeginEditing:self];
}
-(void)textFieldDidEndEditing:(UITextField *)textField {
    // set the model object state when an edit has complete
    self.listItem.listName = textField.text;
    [self.delegate cellDidEndEditing:self];
}
@end
DNZTaskCell.h
#import <UIKit/UIKit.h>
#import "DNZTask.h"
#import "DNZTaskTableViewCellDelegate.h"
@class DNZStrikethroughLabel;
@interface DNZTaskCell : UITableViewCell <UITextFieldDelegate>
// The item that this cell renders
@property (nonatomic) DNZTask *taskItem;
// The object that acts as delegate for this cell.
@property (nonatomic, assign) id<DNZTaskTableViewCellDelegate> delegate;
@end
DNZTaskCell.m
#import "DNZTaskCell.h"
#import <QuartzCore/QuartzCore.h>
#import "DNZStrikethroughLabel.h"
#import "cellConstants.h"
@implementation DNZTaskCell {
    CGPoint _originalCenter;
    BOOL _deleteOnDragRelease;
    DNZStrikethroughLabel *_label;
    UILabel *_crossLabel;
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        _label = [[DNZStrikethroughLabel alloc] initWithFrame:CGRectNull];
        _label.textColor = [UIColor whiteColor];
        _label.font = [UIFont fontWithName:@"nevis" size:28];
        _label.backgroundColor = [UIColor clearColor];
        _label.delegate = self;
        _label.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
        [self addSubview:_label];
        // remove the default blue highlight for selected cells
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        _crossLabel = [self createCueLabel];
        _crossLabel.text = @"\uf00d";
        _crossLabel.textAlignment = NSTextAlignmentLeft;
        [self addSubview:_crossLabel];
        UIPanGestureRecognizer* recognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)];
        recognizer.delegate = self;
        [self addGestureRecognizer:recognizer];
        UITapGestureRecognizer *singleFingerTap =
        [[UITapGestureRecognizer alloc] initWithTarget:self
                                                action:@selector(handleSingleTap:)];
        [self addGestureRecognizer:singleFingerTap];
    }
    return self;
}
-(void)layoutSubviews {
    [super layoutSubviews];
    // ensure the gradient layers occupies the full bounds
    _label.frame = CGRectMake(LABEL_LEFT_MARGIN, 0,
                              self.bounds.size.width-LABEL_LEFT_MARGIN-TASK_LABEL_WIDTH,self.bounds.size.height);
    _crossLabel.frame = CGRectMake(self.bounds.size.width + UI_CUES_MARGIN, 0,
                                   UI_CUES_WIDTH, self.bounds.size.height);
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    // Configure the view for the selected state
}
-(void)setTaskItem:(DNZTask *)taskItem {
    _taskItem = taskItem;
    // we must update all the visual state associated with the model item
    _label.text = [taskItem.taskName uppercaseString];
}
-(UILabel*) createCueLabel {
    UILabel* label = [[UILabel alloc] initWithFrame:CGRectNull];
    label.textColor = [UIColor whiteColor];
    label.font = [UIFont fontWithName:@"FontAwesome" size:28];
    label.backgroundColor = [UIColor clearColor];
    return label;
}
#pragma mark - single tap gesture methods
- (void)handleSingleTap:(UITapGestureRecognizer *)recognizer {
    [self.delegate taskCellClicked:self];
}
#pragma mark - horizontal pan gesture methods
-(BOOL)gestureRecognizerShouldBegin:(UIPanGestureRecognizer *)gestureRecognizer {
    if([gestureRecognizer isKindOfClass:[UILongPressGestureRecognizer class]]) {
        return NO;
    }
    CGPoint translation = [gestureRecognizer translationInView:[self superview]];
    // Check for horizontal gesture
    if (fabsf(translation.x) > fabsf(translation.y)) {
        return YES;
    }
    return NO;
}
-(void)handlePan:(UIPanGestureRecognizer *)recognizer {
    // 1
    if (recognizer.state == UIGestureRecognizerStateBegan) {
        // if the gesture has just started, record the current centre location
        _originalCenter = self.center;
    }
    // 2
    if (recognizer.state == UIGestureRecognizerStateChanged) {
        // translate the center
        CGPoint translation = [recognizer translationInView:self];
        self.center = CGPointMake(_originalCenter.x + translation.x, _originalCenter.y);
        // determine whether the item has been dragged far enough to initiate a delete / complete
        _deleteOnDragRelease = self.frame.origin.x < -_crossLabel.frame.size.width; //-self.frame.size.width / 2;
        // fade the contextual cues
        float cueAlpha = fabsf(self.frame.origin.x) / _crossLabel.frame.size.width;//(self.frame.size.width / 2);
        _crossLabel.alpha = cueAlpha;
        // indicate when the item have been pulled far enough to invoke the given action
        _crossLabel.textColor = _deleteOnDragRelease ?
        [UIColor colorWithRed:242/255.0 green:108/255.0 blue:79/255.0 alpha:1] : [UIColor whiteColor];
    }
    // 3
    if (recognizer.state == UIGestureRecognizerStateEnded) {
        // the frame this cell would have had before being dragged
        CGRect originalFrame = CGRectMake(0, self.frame.origin.y,
                                          self.bounds.size.width, self.bounds.size.height);
        if (!_deleteOnDragRelease) {
            // if the item is not being deleted, snap back to the original location
            [UIView animateWithDuration:0.2
                             animations:^{
                                 self.frame = originalFrame;
                             }
             ];
        }
        if (_deleteOnDragRelease) {
            // notify the delegate that this item should be deleted
            [self.delegate taskItemDeleted:self.taskItem];
        }
    }
}
#pragma mark - UITextFieldDelegate
-(BOOL)textFieldShouldReturn:(UITextField *)textField {
    // close the keyboard on enter
    [textField resignFirstResponder];
    return NO;
}
//
//-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
//    // disable editing of completed to-do items
//    return !self.listItem.completed;
//}
-(void)textFieldDidBeginEditing:(UITextField *)textField {
    [self.delegate cellDidBeginEditing:self];
}
-(void)textFieldDidEndEditing:(UITextField *)textField {
    // set the model object state when an edit has complete
    self.taskItem.taskName = textField.text;
    [self.delegate cellDidEndEditing:self];
}
@end
Error Screenshots
Xcode Error
https://www.dropbox.com/s/ppvb722gteaaxfi/xcode_Error.png
Build Settings
https://www.dropbox.com/s/cljczenwyc7i5pr/build-settings.png
 
     
    