I have the following code:
@interface UIAcceleration (Simulation)
- (id) initWithTimestamp:(NSTimeInterval)aTimeStamp
X:(UIAccelerationValue)ax
Y:(UIAccelerationValue)ay
Z:(UIAccelerationValue)az;
@end
@implementation UIAcceleration (Simulation)
-(id)initWithTimestamp:(NSTimeInterval)aTimeStamp
X:(UIAccelerationValue)ax
Y:(UIAccelerationValue)ay
Z:(UIAccelerationValue)az
{
if (self = [super init])
{
timestamp = aTimeStamp;
x = ax;
y = ay;
z = az;
}
return self;
}
@end
when compiling this for simulator SDK everything works fine. When compiling for device SDK I get the following linker error:
"_OBJC_IVAR_$_UIAcceleration.x", referenced from:
_OBJC_IVAR_$_UIAcceleration.x$non_lazy_ptr in UIAcceleration+IRowAdditions.o
"_OBJC_IVAR_$_UIAcceleration.y", referenced from:
_OBJC_IVAR_$_UIAcceleration.y$non_lazy_ptr in UIAcceleration+IRowAdditions.o
"_OBJC_IVAR_$_UIAcceleration.z", referenced from:
_OBJC_IVAR_$_UIAcceleration.z$non_lazy_ptr in UIAcceleration+IRowAdditions.o
"_OBJC_IVAR_$_UIAcceleration.timestamp", referenced from:
_OBJC_IVAR_$_UIAcceleration.timestamp$non_lazy_ptr in AccelerometerSimulation.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
What am I doing wrong? What is different between linking against Simulator frameworks (namely UIKit) and linking against device frameworks?