如何在uibutton中发送字符串值

时间:2013-02-09 08:49:11

标签: ios objective-c

我在google地图上有一些anotation,我必须在按钮选择上发送那些纬度和经度值到另一个mathod,我试图在“tag”中设置但是它返回null值,任何想法为什么

NSString *str = [NSString stringWithFormat:@"%f, %f", annotation.coordinate.latitude, annotation.coordinate.longitude];

       // NSLog(@"%@",str);

        UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeCustom];
        rightButton.frame = CGRectMake(30, 0, 32, 32);
        [rightButton setImage:[UIImage imageNamed:@"getdirections.png"] forState:UIControlStateNormal];
        [rightButton setTitle:annotation.title forState:UIControlStateNormal];

        [rightButton addTarget:self action:@selector(showDetails:) forControlEvents:UIControlEventTouchUpInside];
        annotationView.rightCalloutAccessoryView = rightButton;
        return annotationView;

事先提前

0 个答案:

没有答案