Take the 2-minute tour ×

I keep getting this semantic issue from the time i change from xcode 3 to 4

my code worked without any problem, but this keep coming when i'm using xcode 4...

: Assigning to 'Main *' from incompatible type 'NSString *';

How do i fix it? i tried remove: " self.delegate=[[[NSString alloc] init] autorelease]; "

but removing it... is not a really fix

-(id)init {
    if (self=[super init])



    return self;
share|improve this question
A string can't be a delegate normally... where is your delegate declared? –  Dustin Jul 11 '12 at 18:04
so what should a do to remove the warning , how to fix it? the delegate is declared inside Hover.h –  user1508409 Jul 11 '12 at 18:04
How is delegate defined? (It's hard to imagine that a string would be useful.) –  Phillip Mills Jul 11 '12 at 18:04
Don't use a string as a delegate? What are you trying to do here? –  Dustin Jul 11 '12 at 18:05

1 Answer 1

up vote 5 down vote accepted

The literal answer is that you should use an object of whatever class delegate is defined as and assign that instead of the string. (Either pass it an existing object or create a new one, depending on the program logic.)

The real answer, though, would come from asking yourself: why is this delegate here and what is its purpose?

share|improve this answer

Your Answer


