小编fil*_*lou的帖子

iOS:用户位置变为pin

我有一个奇怪的行为mapView:当我打开它,一切正常.将找到用户(蓝色圆圈)并且3个针脚就位.但是(我不知道为什么)一段时间后,蓝点变成了一个引脚 - 但只有当我的连接速度很慢时才会这样.

这是我得到的:

- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation
{
    MKPinAnnotationView *pinView = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:@"pinView"];

    if (!pinView && ![annotation isKindOfClass:[MKUserLocation class]])
    {
        pinView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"pinView"];
        pinView.pinColor = MKPinAnnotationColorRed;
        pinView.animatesDrop = YES;
        pinView.canShowCallout = YES;

        UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
        pinView.rightCalloutAccessoryView = rightButton;

        if (annotation == self.locationZH1)
        {
            [pinView setTag:1];
        }
        else if (annotation == self.locationZH2)
        {
            [pinView setTag:2];
        }
        else if (annotation == self.locationZH3)
        {
            [pinView setTag:3];
        }
        else if (annotation == self.locationLU1)
        {
            [pinView …
Run Code Online (Sandbox Code Playgroud)

mkmapview ios

3
推荐指数
2
解决办法
3143
查看次数

iOS6:如何通过Identifier在Storyboard中连接UIViewController?

有没有人知道如何将Storyboard中的UIViewControllers与标识符连接?它似乎不再工作..

iphone xcode storyboard ios ios6

2
推荐指数
1
解决办法
3326
查看次数

iOS:NSString丢失URL,显示(null)

这是我的代码到目前为止:

NSString *listedImageURL = listedProduct.image;

NSLog(@"URL: %@", listedImageURL);
Run Code Online (Sandbox Code Playgroud)

此代码工作正常,NSLog显示正确的URL.但是,当我尝试以下代码时,NSLog显示(null):

NSString *listedImageURL = listedProduct.image;

NSURL *imageURL = [NSURL URLWithString:listedImageURL];
NSData *imageData = [NSData dataWithContentsOfURL:imageURL];
UIImage *image = [UIImage imageWithData:imageData];
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么??

url null xcode nsstring ios

1
推荐指数
1
解决办法
1812
查看次数

iOS 7:UINavigationController下拉UIScrollview

我有一个全屏UIScrollView,我在其中放置我的UIImageView(子视图).但是当我将此控制器与我的UINavigationController连接时,其中的图像被拉下(与条形图相同的高度).

尝试以下方法:

self.edgesForExtendedLayout = UIRectEdgeNone;

还尝试重置帧位置或偏移.什么都没有帮助.

cocoa-touch objective-c uiscrollview uinavigationcontroller ios

1
推荐指数
1
解决办法
88
查看次数

iOS:NSMutableArray为空

for (XMLProductView *pV in entries) {
        NSString *test = pV.appName;
        [allTableData addObject:test];

        NSLog(@"Entries: %@", allTableData);
    }
Run Code Online (Sandbox Code Playgroud)

在我,NSString *test我得到所有结果.为什么会出现NSMutableArray'allTableData' Null

memory-management objective-c nsmutablearray ios

0
推荐指数
1
解决办法
726
查看次数