如果我的问题标题似乎根本不知情,我很抱歉。让我解释一下我想要做什么。
我定义了以下 UIViewController 子类,它会启动 LocationManager,并有一个开始录制按钮来保存 GPS 轨迹。
现在我还想启动加速度计并允许用户记录它。
我的 ViewController 子类是 LocationManager 委托,那么我应该为 Accelerometer 委托使用什么?我可以使用同一个视图,还是需要定义一个子视图?
这是我的 UIViewController 子类的接口:
@interface RootViewController : UIViewController <CLLocationManagerDelegate> {
NSMutableArray *eventsArray;
NSManagedObjectContext *managedObjectContext;
CLLocationManager *locationManager;
BOOL recording;
UILabel *pointLabel;
UIButton *startStop;
}
-(void)toggleButton;
如果需要,我可以发布更多代码,但我认为这就是全部。感谢您的帮助,我刚刚进入 iPhone 开发领域,我的专长(如果有的话)在于无指针编程语言 :)