Question

I found this Color Picker online and I am currently trying to implement it into my code. I followed all the instructions to implement it but when I try to load the ViewController that came with the code (using a UITableView cell), I get an Apple Mach-o Linker Error when I try to build and/or run the code saying:

Undefined symbols for architecture armv7: "_OBJC_CLASS_$_ColorPickerViewController", referenced from: objc-class-ref in ClockSettingsViewController.o ld: symbol(s) not found for architecture armv7

All I'm doing is loading the view into the hierarchy at the point of the crash (the next line is the one that I present the view). I built every part separately in xcode and found that this line of code is the source of the error:

 ColorPickerViewController *colorView = [[ColorPickerViewController alloc] init];

And that code is sitting here:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

    if (indexPath.row == 0) {
        ColorPickerViewController *colorView = [[ColorPickerViewController alloc] init];
        [self presentViewController:colorView animated:YES completion:nil];
    }
}

I have used this method for opening views hundreds of times (in fact, it is the only way I've ever used), so I know that it can't be the code itself, and I checked everywhere and I imported everything I needed. What is wrong and what does the error mean so I can fix it in the future. Thanks in advanced.

Was it helpful?

Solution

Go to your Project->Targets and on the Build Phases tab, make sure the file ColorPickerViewController.m is added to the list of Compile Sources files.

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top