1
votes

I have read plenty of questions and answers here about weak linking, checking if a class is valid before executing code etc. My app is basically finished and ready (at least I thought it was, my first app for the store) but I need to fix this problem so my app natively runs on the iPad.

The error I'm receiving is the following: * Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: '* -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (ADBannerView)'

My question to you pro's out there is, I am setting some IBOutlet properties in my class header. For example; @property (nonatomic, retain) IBOutlet ADBannerView *tollBanner;

Is this property causing the problem when trying to run the app on the iPad? I have added some conditionals in my viewDidLoad method if the ADBannerView class not nil. Also in my dealloc method I'm releasing these ADBannerView objects.

I would appreciate any help with this and TIA.

T

2

2 Answers

3
votes

it's possible the creation of the object is derived from a nib/xib.

if your nib/xib requires custom classes which are available on some platforms/OS versions, you must either:

1) add it programmatically

-or-

2) create multiple nibs (for each localization), then load the nib specific for the current runtime

the former sounds more simple, in most cases.

(ps: the callstack would help)

1
votes

According to the iOS documentation for ADBannerView:

Available in iOS 4.0 and later.

The iPad's iOS version is currently 3.2* so you will not be able to use this class on the iPad.

*4.2 was recently seeded to developers (if the media reports are accurate) but your app will crash on iDevices running iOS earlier than 4.0 regardless of the hardware.