Je travaille sur cette application iPhone pendant un moment maintenant et je l'avais complètement terminé et travailler. Le projet que je développais a été téléchargé depuis un référentiel de subversion en ligne que mon professeur m'avait donné accès aussi. Je n'ai accidentellement pas téléchargé la copie "root" ou quelque chose comme ça, alors je n'ai pas pu commettre des modifications apportées au référentiel. Avec mes instructeurs aidez, j'ai téléchargé la copie root aujourd'hui et j'ai ajouté tous mes fichiers de classe afin que je puisse commettre les modifications. Cependant, je reçois maintenant 3 erreurs étranges que je n'ai jamais vues auparavant:
symboles non définis: p>
"_ objc_class _ $ _ mapListViewController", référencé de: Objc-Class-Ref-to-MapListViewController dans mapviewcontroller.o p>
"_ objc_class _ $ _ mapparser", référencé de: Objc-Class-Ref-to-Mapparser dans MapViewController.o P>
"_ objc_class _ $ _ mapTabviewController", référencé de: Objc-Class-Ref-to-MapTabviewController dans mapviewcontroller.o p>
LD: Symbole (s) non trouvé Collect2: LD Retourné 1 statut de sortie p> BlockQuote>
C'est le message d'erreur exact que je reçois. Je n'ai changé aucun code de la version qui fonctionnait complètement plus tôt ce matin. Aucun conseil? Le fichier MapViewController semble être ce qui cause le problème, alors voici aussi: P>
#import "mapViewController.h" #import "locationDetailViewController.h" #import "DPUAnnotation.h" #import "mapParser.h" #import "mapListViewController.h" #import "mapTabViewController.h" @implementation mapViewController @synthesize locationManager, mapView, mapAnnotations, mParser, mapListView, tabView; @class DPUAnnotation; + (CGFloat)annotationPadding; { return 10.0f; } + (CGFloat)calloutHeight; { return 40.0f; } - (void)gotoLocation { // start off by default at DePauw campus MKCoordinateRegion newRegion; newRegion.center.latitude = 39.639348; newRegion.center.longitude = -86.861231; newRegion.span.latitudeDelta = 0.006776; newRegion.span.longitudeDelta = 0.006291; [self.mapView setRegion:newRegion animated:YES]; } - (void)viewDidLoad { self.title = @"Map"; mapView.mapType = MKMapTypeHybrid; mapView.showsUserLocation = YES; mapListView = [[mapListViewController alloc] initWithNibName:@"mapListView" bundle:nil]; tabView = [[mapTabViewController alloc] initWithNibName:@"mapTabViewController" bundle:nil]; if (mapAnnotations == nil) { self.mapAnnotations = [NSMutableArray array]; } else { [mapAnnotations removeAllObjects]; } UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"btn_home.png"] style:UIBarButtonItemStyleBordered target:self action:@selector(mainpageClicked)]; [self.navigationItem setLeftBarButtonItem:backButton]; UIBarButtonItem *mapListButton = [[UIBarButtonItem alloc] initWithTitle:@"Building List" style:UIBarButtonItemStylePlain target:self action:@selector(pushMapList)]; [self.navigationItem setRightBarButtonItem: mapListButton]; locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; locationManager.desiredAccuracy = kCLLocationAccuracyBest; [locationManager startUpdatingLocation]; [self gotoLocation]; self.mParser = [[[mapParser alloc] init] autorelease]; self.mParser.delegate = self; [self.mParser start]; [super viewDidLoad]; } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:(BOOL)animated]; } - (void)dealloc { [mapView release]; [locationManager release]; [mapAnnotations release]; [super dealloc]; } /* * Returns the User to the main Application Page */ - (IBAction)mainpageClicked { NSLog(@"Return To Main page Clicked"); [self.parentViewController dismissModalViewControllerAnimated:YES]; [self.navigationController release]; } - (IBAction) pushMapList { tabView = [[mapTabViewController alloc] initWithNibName:@"mapTabViewController" bundle:nil]; tabView.mapAnnotations2 = mapAnnotations; [self.navigationController pushViewController:tabView animated:YES]; [tabView release]; } - (IBAction)addAnnotation { [self.mapView removeAnnotations:self.mapView.annotations]; for (int i = 0; i < [mapAnnotations count]; i++) [mapView addAnnotation:[mapAnnotations objectAtIndex:i]]; NSLog(@"BLAH BLAH BLAH PLEASE PRINT"); if([mapAnnotations count] == 0) NSLog(@"array is empty"); } - (void)showDetails:(id)sender { NSInteger selectedIndex = [sender tag]; DPUAnnotation *selectedObject = [mapAnnotations objectAtIndex:selectedIndex]; [self.navigationController setToolbarHidden:YES animated:NO]; NSURL *url = [NSURL URLWithString: selectedObject.url]; locationDetailViewController *locationDetailView; locationDetailView = [[locationDetailViewController alloc] initWithNibName:@"mapDetailView" bundle:nil]; [self.navigationController pushViewController:locationDetailView animated:YES]; [locationDetailView.webView loadRequest: [NSURLRequest requestWithURL:url]]; [locationDetailView release]; [selectedObject release]; } - (MKAnnotationView *)mapView:(MKMapView *)theMapView viewForAnnotation:(id <MKAnnotation>)annotation { // if it's the user location, just return nil. if ([annotation isKindOfClass:[MKUserLocation class]]) return nil; if([[annotation subtitle] isEqualToString:@"Academic"]) { // try to dequeue an existing pin view first static NSString* annotationIdentifier = @"annotationIdentifier"; MKPinAnnotationView* pinView = (MKPinAnnotationView *)[theMapView dequeueReusableAnnotationViewWithIdentifier:annotationIdentifier]; if (!pinView) { MKAnnotationView *annotationView = [[[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:annotationIdentifier] autorelease]; annotationView.canShowCallout = YES; UIImage *academicImage = [UIImage imageNamed:@"academic.png"]; CGRect resizeRect; resizeRect.size = academicImage.size; CGSize maxSize = CGRectInset(self.view.bounds, [mapViewController annotationPadding], [mapViewController annotationPadding]).size; maxSize.height -= self.navigationController.navigationBar.frame.size.height + [mapViewController calloutHeight]; if (resizeRect.size.width > maxSize.width) resizeRect.size = CGSizeMake(maxSize.width, resizeRect.size.height / resizeRect.size.width * maxSize.width); if (resizeRect.size.height > maxSize.height) resizeRect.size = CGSizeMake(resizeRect.size.width / resizeRect.size.height * maxSize.height, maxSize.height); resizeRect.origin = (CGPoint){0.0f, 0.0f}; UIGraphicsBeginImageContext(resizeRect.size); [academicImage drawInRect:resizeRect]; UIImage *resizedImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); annotationView.image = resizedImage; annotationView.opaque = NO; UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; NSInteger annotationValue = [self.mapAnnotations indexOfObject:annotation]; rightButton.tag = annotationValue; [rightButton addTarget:self action:@selector(showDetails:) forControlEvents:UIControlEventTouchUpInside]; annotationView.rightCalloutAccessoryView = rightButton; return annotationView; } else { pinView.annotation = annotation; } return pinView; } else if([[annotation subtitle] isEqualToString:@"Administrative"]) { // try to dequeue an existing pin view first static NSString* annotationIdentifier = @"annotationIdentifier"; MKPinAnnotationView* pinView = (MKPinAnnotationView *)[theMapView dequeueReusableAnnotationViewWithIdentifier:annotationIdentifier]; if (!pinView) { MKAnnotationView *annotationView = [[[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:annotationIdentifier] autorelease]; annotationView.canShowCallout = YES; UIImage *administrativeImage = [UIImage imageNamed:@"administrative.png"]; CGRect resizeRect; resizeRect.size = administrativeImage.size; CGSize maxSize = CGRectInset(self.view.bounds, [mapViewController annotationPadding], [mapViewController annotationPadding]).size; maxSize.height -= self.navigationController.navigationBar.frame.size.height + [mapViewController calloutHeight]; if (resizeRect.size.width > maxSize.width) resizeRect.size = CGSizeMake(maxSize.width, resizeRect.size.height / resizeRect.size.width * maxSize.width); if (resizeRect.size.height > maxSize.height) resizeRect.size = CGSizeMake(resizeRect.size.width / resizeRect.size.height * maxSize.height, maxSize.height); resizeRect.origin = (CGPoint){0.0f, 0.0f}; UIGraphicsBeginImageContext(resizeRect.size); [administrativeImage drawInRect:resizeRect]; UIImage *resizedImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); annotationView.image = resizedImage; annotationView.opaque = NO; UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; NSInteger annotationValue = [self.mapAnnotations indexOfObject:annotation]; rightButton.tag = annotationValue; [rightButton addTarget:self action:@selector(showDetails:) forControlEvents:UIControlEventTouchUpInside]; annotationView.rightCalloutAccessoryView = rightButton; return annotationView; } else { pinView.annotation = annotation; } return pinView; } else if([[annotation subtitle] isEqualToString:@"University Housing"] || [[annotation subtitle] isEqualToString:@"Residence Halls"] || [[annotation subtitle] isEqualToString:@"University Duplexes"] || [[annotation subtitle] isEqualToString:@"Greek Housing"]) { // try to dequeue an existing pin view first static NSString* annotationIdentifier = @"annotationIdentifier"; MKPinAnnotationView* pinView = (MKPinAnnotationView *)[theMapView dequeueReusableAnnotationViewWithIdentifier:annotationIdentifier]; if (!pinView) { MKAnnotationView *annotationView = [[[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:annotationIdentifier] autorelease]; annotationView.canShowCallout = YES; UIImage *housingImage = [UIImage imageNamed:@"housing.png"]; CGRect resizeRect; resizeRect.size = housingImage.size; CGSize maxSize = CGRectInset(self.view.bounds, [mapViewController annotationPadding], [mapViewController annotationPadding]).size; maxSize.height -= self.navigationController.navigationBar.frame.size.height + [mapViewController calloutHeight]; if (resizeRect.size.width > maxSize.width) resizeRect.size = CGSizeMake(maxSize.width, resizeRect.size.height / resizeRect.size.width * maxSize.width); if (resizeRect.size.height > maxSize.height) resizeRect.size = CGSizeMake(resizeRect.size.width / resizeRect.size.height * maxSize.height, maxSize.height); resizeRect.origin = (CGPoint){0.0f, 0.0f}; UIGraphicsBeginImageContext(resizeRect.size); [housingImage drawInRect:resizeRect]; UIImage *resizedImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); annotationView.image = resizedImage; annotationView.opaque = NO; UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; NSInteger annotationValue = [self.mapAnnotations indexOfObject:annotation]; rightButton.tag = annotationValue; [rightButton addTarget:self action:@selector(showDetails:) forControlEvents:UIControlEventTouchUpInside]; annotationView.rightCalloutAccessoryView = rightButton; return annotationView; } else { pinView.annotation = annotation; } return pinView; } else if([[annotation subtitle] isEqualToString:@"Other"]) { // try to dequeue an existing pin view first static NSString* annotationIdentifier = @"annotationIdentifier"; MKPinAnnotationView* pinView = (MKPinAnnotationView *)[theMapView dequeueReusableAnnotationViewWithIdentifier:annotationIdentifier]; if (!pinView) { MKAnnotationView *annotationView = [[[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:annotationIdentifier] autorelease]; annotationView.canShowCallout = YES; UIImage *otherImage = [UIImage imageNamed:@"other.png"]; CGRect resizeRect; resizeRect.size = otherImage.size; CGSize maxSize = CGRectInset(self.view.bounds, [mapViewController annotationPadding], [mapViewController annotationPadding]).size; maxSize.height -= self.navigationController.navigationBar.frame.size.height + [mapViewController calloutHeight]; if (resizeRect.size.width > maxSize.width) resizeRect.size = CGSizeMake(maxSize.width, resizeRect.size.height / resizeRect.size.width * maxSize.width); if (resizeRect.size.height > maxSize.height) resizeRect.size = CGSizeMake(resizeRect.size.width / resizeRect.size.height * maxSize.height, maxSize.height); resizeRect.origin = (CGPoint){0.0f, 0.0f}; UIGraphicsBeginImageContext(resizeRect.size); [otherImage drawInRect:resizeRect]; UIImage *resizedImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); annotationView.image = resizedImage; annotationView.opaque = NO; UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; NSInteger annotationValue = [self.mapAnnotations indexOfObject:annotation]; rightButton.tag = annotationValue; [rightButton addTarget:self action:@selector(showDetails:) forControlEvents:UIControlEventTouchUpInside]; annotationView.rightCalloutAccessoryView = rightButton; return annotationView; } else { pinView.annotation = annotation; } return pinView; } else if([[annotation subtitle] isEqualToString:@"Fields"]) { // try to dequeue an existing pin view first static NSString* annotationIdentifier = @"annotationIdentifier"; MKPinAnnotationView* pinView = (MKPinAnnotationView *)[theMapView dequeueReusableAnnotationViewWithIdentifier:annotationIdentifier]; if (!pinView) { MKAnnotationView *annotationView = [[[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:annotationIdentifier] autorelease]; annotationView.canShowCallout = YES; UIImage *athleticsImage = [UIImage imageNamed:@"athletics.png"]; CGRect resizeRect; resizeRect.size = athleticsImage.size; CGSize maxSize = CGRectInset(self.view.bounds, [mapViewController annotationPadding], [mapViewController annotationPadding]).size; maxSize.height -= self.navigationController.navigationBar.frame.size.height + [mapViewController calloutHeight]; if (resizeRect.size.width > maxSize.width) resizeRect.size = CGSizeMake(maxSize.width, resizeRect.size.height / resizeRect.size.width * maxSize.width); if (resizeRect.size.height > maxSize.height) resizeRect.size = CGSizeMake(resizeRect.size.width / resizeRect.size.height * maxSize.height, maxSize.height); resizeRect.origin = (CGPoint){0.0f, 0.0f}; UIGraphicsBeginImageContext(resizeRect.size); [athleticsImage drawInRect:resizeRect]; UIImage *resizedImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); annotationView.image = resizedImage; annotationView.opaque = NO; UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; NSInteger annotationValue = [self.mapAnnotations indexOfObject:annotation]; rightButton.tag = annotationValue; [rightButton addTarget:self action:@selector(showDetails:) forControlEvents:UIControlEventTouchUpInside]; annotationView.rightCalloutAccessoryView = rightButton; return annotationView; } else { pinView.annotation = annotation; } return pinView; } else if([[annotation subtitle] isEqualToString:@"Landmarks"]) { // try to dequeue an existing pin view first static NSString* annotationIdentifier = @"annotationIdentifier"; MKPinAnnotationView* pinView = (MKPinAnnotationView *)[theMapView dequeueReusableAnnotationViewWithIdentifier:annotationIdentifier]; if (!pinView) { MKAnnotationView *annotationView = [[[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:annotationIdentifier] autorelease]; annotationView.canShowCallout = YES; UIImage *landmarkImage = [UIImage imageNamed:@"landmark.png"]; CGRect resizeRect; resizeRect.size = landmarkImage.size; CGSize maxSize = CGRectInset(self.view.bounds, [mapViewController annotationPadding], [mapViewController annotationPadding]).size; maxSize.height -= self.navigationController.navigationBar.frame.size.height + [mapViewController calloutHeight]; if (resizeRect.size.width > maxSize.width) resizeRect.size = CGSizeMake(maxSize.width, resizeRect.size.height / resizeRect.size.width * maxSize.width); if (resizeRect.size.height > maxSize.height) resizeRect.size = CGSizeMake(resizeRect.size.width / resizeRect.size.height * maxSize.height, maxSize.height); resizeRect.origin = (CGPoint){0.0f, 0.0f}; UIGraphicsBeginImageContext(resizeRect.size); [landmarkImage drawInRect:resizeRect]; UIImage *resizedImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); annotationView.image = resizedImage; annotationView.opaque = NO; UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; NSInteger annotationValue = [self.mapAnnotations indexOfObject:annotation]; rightButton.tag = annotationValue; [rightButton addTarget:self action:@selector(showDetails:) forControlEvents:UIControlEventTouchUpInside]; annotationView.rightCalloutAccessoryView = rightButton; return annotationView; } else { pinView.annotation = annotation; } return pinView; } return nil; } #pragma mark <mapParser> Implementation - (void)parser:(NSXMLParser *)parser didFailWithError:(NSError *)parseError { } - (void)parserDidEndParsingData:(mapParser *)parser { [self addAnnotation]; tabView.mapAnnotations2 = mapAnnotations; self.mParser = nil; [mParser release]; } - (void)parser:(mapParser *)parser didParseItem:(NSArray *)parsedItem { NSLog(@"Did Parse Map Item"); [self.mapAnnotations addObjectsFromArray:parsedItem]; } - (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error {} - (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark {} @end
5 Réponses :
Très probablement Ces trois classes sont manquantes dans votre fichier de projet. Vérifiez le groupe Classes dans votre projet Xcode pour voir si ces trois fichiers sont présents. Sinon, cliquez dessus avec le bouton droit de la souris sur le groupe Classes, puis cliquez sur Ajouter> Fichiers existants pour les ajouter. P>
Si les fichiers sont ajoutés au projet, assurez-vous que les fichiers de mise en œuvre (.M) de ces classes manquantes sont ajoutés aux sources compilées. Pour vérifier que, développez le groupe cibles> Votre objectif d'application> Compilez les sources code> et voyez si les fichiers sont présents. Sinon, cliquez avec le bouton droit de la souris sur "Compiler des sources" et goto
Ajouter> Fichiers existants CODE> Pour les ajouter. Une solution alternative et peut-être plus rapide de faire la même chose consiste à sélectionner les fichiers .M pour chacune des classes manquantes et à voir si la case à taureaux à l'œil à l'extrême droite est vérifiée. Sinon, alors vérifiez-le et il sera automatiquement ajouté aux sources compilées. P>
Bien que ce n'était pas exactement ce qui n'allait pas, vous m'avez conduit dans la bonne direction = d. J'ai déjà ajouté les fichiers de classe, mais dans la liste des classes, il existe une ligne cible de cases à cocher et les cases de ces classes n'étaient pas cochées. Je ne savais même pas que cela existait jusqu'à maintenant lol ... merci pour l'aide!
parfait. Heureux que vous soyez tous prêt à commencer à coder :). Pour un saké complet et d'autres utilisateurs qui peuvent avoir le même problème, je mettrai à jour cette réponse.
Tu viens d'avoir sauvé ma journée
J'avais le même problème que j'ai résolu en ajoutant le cadre dans Xcode P>
J'ai fait l'exact opposé et ça a fonctionné pour moi. Je ne sais pas comment xcode arrive avec ces erreurs ... :)
Lorsque vous ajoutez Coregraphics LIBRAYAY.Vous devez sélectionner le nom de projet_> Nom de projet / Sélectionnez le nom du projet (NON Sélectionnez le nom du test de projet, sa erreur que vous avez face) -> Buildseting-> et Ajouter Corelouer.framework P>
"_ objc_class _ $ _ _ mapListViewController", référencé de: Objc-Class-Ref-to-MapListViewController dans MapViewController.o P>
"_ objc_class _ $ _ mapparser", référencé de: Objc-Class-Ref-to-Mapparser dans MapViewController.o P>
"_ objc_class _ $ _ mapTabviewController", référencé de: Objc-Class-Ref-to-MapTabviewController dans MapViewController.o P>
LD: symbole (s) non trouvé Collecte2: LD renvoyé 1 statut de sortie p> blockQuote>
Assurez-vous que tous (MapListViewController, Mapparser, MapTabviewController) ont à la fois @interface et @Implementatation P>
Cela résolvez mon problème. Je manquai de manquer @Implementatation manquait p>
J'avais ce problème lorsque j'essayais d'avoir J'espère que cela aide toute personne là-bas. J'ai perdu 1 heure de trouver cette solution. P> POD 'Firebaseremoteconfig code> Inside Extensions d'application. J'ai ajouté
$ (hérité) code> au lieu de
-Objc code> à d'autres drapeaux de liaison forts> dans les paramètres de construction de la cible d'extension. P>
Vérifiez ma réponse J'ai résolu ce problème ici