我正在尝试使用徽标来连接CLLocationManager's委托属性的设置。我当前的代码如下所示:
%hook CLLocationManager
-(void)startUpdatingLocation
{
%orig;
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"test"
message:@"hello!"
delegate:nil
cancelButtonTitle:@"Bye"
otherButtonTitles:nil];
[alert show];
[alert release];
}
%end我想重写委托属性的设置,这样我就可以创建一个代理类来过滤发送到应用程序的位置。有没有什么很好的方法可以使用徽标做到这一点呢?
谢谢!
发布于 2012-05-22 12:15:13
是啊。由于属性设置器只是一个常规方法,因此您可以这样做:
%hook CLLocationManager
- (void) setDelegate:(id<CLLocationManagerDelegate>)delegate {
// set up your proxy / whatever you're looking to do
%orig;
}
%endhttps://stackoverflow.com/questions/10674931
复制相似问题