Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6665155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:41:35+00:00 2026-05-26T02:41:35+00:00

I tried to implement this: UICRouteOverlayMapView .h file @protocol DrawingDataDelegate <NSObject> @required -(void) drawingSuccessful:(BOOL)done;

  • 0

I tried to implement this:

UICRouteOverlayMapView

.h file
@protocol DrawingDataDelegate <NSObject>
@required
-(void) drawingSuccessful:(BOOL)done;
@end

@interface UICRouteOverlayMapView : UIView {
    id <DrawingDataDelegate> delegate;
}

- (id)initWithMapView:(MKMapView *)mapView;

@property (nonatomic, retain) id <DrawingDataDelegate> delegate;
@end

 .m file
@implementation UICRouteOverlayMapView
@synthesize delegate;

- (void)drawRect:(CGRect)rect {
         NSLog(@"mesagge");
        if ([self.delegate respondsToSelector:@selector(drawingSuccessful:)]) {
            [self.delegate drawingSuccessful:YES];
        }
    }

The class that adopts the protocol:

.h file
#import "UICRouteOverlayMapView.h"

@class  UICRouteOverlayMapView;

@interface ItineraireViewController : UIViewController <MKMapViewDelegate, UICGDirectionsDelegate, CLLocationManagerDelegate, 
           DrawingDataDelegate> {

               UICRouteOverlayMapView *routeOverlayMapView;
}

    .m file
- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    routeOverlayMapView = [[UICRouteOverlayMapView alloc] init];
    routeOverlayMapView.delegate = self;
}

-(void) drawingSuccessful:(BOOL)done{
    NSLog(@"it's done");
}

Now, what am I doing wrong cause the method drawingSuccessful never gets called?

I know for sure that the method

- (void)drawRect:(CGRect)rect {
         NSLog(@"mesagge");
        if ([self.delegate respondsToSelector:@selector(drawingSuccessful:)]) {
            [self.delegate drawingSuccessful:YES];
        }
    }

is called because this gets displayed NSLog(@"mesagge");.Please help

I did debug and set breakpoint at this line:

   if ([self.delegate respondsToSelector:@selector(drawingSuccessful:)])

and I noticed that this is not a valid condition…it never enters the brackets…so this
it is not compiled [self.delegate drawingSuccessful:YES]; .
So, what is wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:41:36+00:00Added an answer on May 26, 2026 at 2:41 am

    Does the route overlay map view already appear in your nib? In your view didLoad you are creating a new instance of it, setting it’s delegate, and then…nothing. You would normally be adding it to your subview, unless, as I say, it already exists in your nib file.

    If it does, either set an outlet in UICRouteOverlayMapView and connect the delegate in interface builder, or within your viewDidLoad, set the delegate on whatever instance variable you are using to represent the actual map view.

    It may just be a matter of removing this line:

     routeOverlayMapView = [[UICRouteOverlayMapView alloc] init];
    

    If routeOverlayMapView is already pointing at your real view.

    You are probably not entering that last if statement because your delegate is nil. The statement itself is redundant anyway since the method is required in your protocol.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried to implement this: namespace Test { void* operator new(size_t s) { return
I am required to implement a functionality similar to SO voting. I tried to
I tried to implement this. My original post is here iphone: playing audio playlist
i tried to implement this code that move UIImageView's objects, i get a compiler
I have tried to implement this jQuery active menu code: http://docs.jquery.com/Tutorials:Auto-Selecting_Navigation $(function(){ var path
I tried to implement this captcha http://www.dracon.biz/captcha.php to a script But It seems really
So... thanks to one of stackoverflow users I tried to implement this fancy feature
I would like to implement this class SecurityTransgression < StandardError; end def create raise
I want to resolve in Windsor a series of classes that implement this interface:
My so far not-so-bad version to implement this is: function bashFileConvert($file) { return preg_replace('/([^\/\s]+\s+[^\/]+)(\/|$)/','${1}${2}',$file);

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.