Search Results

Search found 2 results on 1 pages for 'funatsg'.

Page 1/1 | 1 

  • Custom Annotation not showing all

    - by funatsg
    Okay, i have a number of pins on the mapkit. These pins showing different types of attractions. (E.g Parks, Farms and etc) I want to add custom images for these different types of pin. Parks have a park image and vice versa. However, when i added in, not all the images are showing successfully. For example, in parks, it should have 5 pins, but the image only came up in 2 pins, whereas other 3 is in default red pins. But if i used colours to differentiate them. For example, [pinsetPinColor:MKPinAnnotationColorGreen]; It works! Anyone knows what is the problem? Relevant codes below. Tell me if you need more. thanks! - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation{ if ([annotation isKindOfClass:MKUserLocation.class]) { //user location view is being requested, //return nil so it uses the default which is a blue dot... return nil; } //NSLog(@"View for Annotation is called"); MKPinAnnotationView *pin=[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:nil]; pin.userInteractionEnabled=TRUE; MapEvent* event = (MapEvent*)annotation; NSLog(@"thetype: %@", event.thetype); if ([event.thetype isEqualToString:@"adv"]) { //[pin setPinColor:MKPinAnnotationColorGreen]; pin.image = [UIImage imageNamed:@"padv.png"]; } else if ([event.thetype isEqualToString:@"muse"]){ //[pin setPinColor:MKPinAnnotationColorPurple]; pin.image = [UIImage imageNamed:@"pmuse.png"]; } else if ([event.thetype isEqualToString:@"nightlife"]){ pin.image = [UIImage imageNamed:@"pnight.png"]; } else if ([event.thetype isEqualToString:@"parks"]){ pin.image = [UIImage imageNamed:@"ppark.png"]; } else if ([event.thetype isEqualToString:@"farms"]){ pin.image = [UIImage imageNamed:@"pfarm.png"]; } else { [pin setPinColor:MKPinAnnotationColorRed]; } pin.canShowCallout = YES; pin.animatesDrop = YES; UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; [rightButton addTarget:self action:@selector(clickAnnotation:) forControlEvents:UIControlEventTouchUpInside]; [rightButton setTitle:event.uniqueID forState:UIControlStateNormal]; pin.rightCalloutAccessoryView = rightButton; return pin; }

    Read the article

  • App crashing when upgraded xcode

    - by funatsg
    Hi guys! I have this problem of my app crashing (only when press a certain UIButton) after i upgraded my xcode to the latest 3.2.5 and iPhone simulator 4.2. It works fine in my friend laptop, who hasn't upgraded yet. I googled for answers, but most of them faces problem only crashing in simulator but not device. Mine crashes for both. Anyone has any idea about this issue? I cant seem to find any solution.

    Read the article

1