1

I just incorporated UrbanAirship-1.3.3 into my project following the instructions from the UrbanAirship site and having #imported the appropriate headers, it compiles fine. However inside my app delegate's method

-(BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:NSDictionary*)launchOptions

the line:

[UAStoreFront useCustomUI:[UAStoreFrontUI class]];

which is now required to use Urban Airship, results in the these linker errors:

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_UAStoreFrontUI", referenced from:
      objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The header file(UAStoreFrontUI.h) imports without issue, but as soon as I call code from it(e.g. [UAStoreFrontUI class]) the linker starts complaining. I find this especially odd as UAirship.h and UAStoreFront.h are linked and usable without error.

I'm fairly new to xcode, so there may be a build setting or something I'm overlooking but, other than that, at this point I've hit a brick wall and not sure how to procceed. Any insight would be appreciated

vigilance
  • 116
  • 1
  • 11
  • 1
    Check that libUrbanAirship.a is being linked in the "Link binary with libraries" section of the target build phase. – mattjgalloway Oct 23 '12 at 20:16
  • @mattj yup, the file is there under "Link Binary with Libraries". I'm not sure how relevant this might be but, I've gone over the tutorial at least 15 times, and the only deviation I can find is that under "Header Search Paths" in Build Settings the tutorial says to add "../Airship/**". Doing so yields a linker error, so instead I tried "$(SRCROOT)/Airship/**", which works fine but I still get a linker error when accessing code from "UIStoreFrontUI.h" – vigilance Oct 24 '12 at 14:53

2 Answers2

0

Oh, I have just looked at Urban Airship and UAStoreFrontUI is actually just an example of a class conforming to the UAStoreFrontUIProtocol protocol. i.e. it's not a class that comes in the library.

You should make your own but I guess if you do want to use their example one then you'd need to include UAStoreFrontUI.h and UAStoreFrontUI.m in your project just like you add your own files to your project.

mattjgalloway
  • 34,792
  • 12
  • 100
  • 110
  • I finally managed to figured out the issue after stumbling around the internet for a few hours. thanks for the input, your suggestions definitely helped narrow the search. cheers! – vigilance Nov 07 '12 at 16:03
0

The linker errors where the result of not adding the .m, .xib and other resource files to Build Phases under Copy Bundle Resources. It seems the appropriate files must be explicitly added individually, under Copy Bundle Resources, as adding the folder in which those files exist does not seem work. This is not documented in the Urban Airship tutorial... for some reason.

The solution I stumbled upon can be found here for further reading

Community
  • 1
  • 1
vigilance
  • 116
  • 1
  • 11