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])
{
self.delegate=[[[NSString alloc] init] autorelease];
}
return self;
}
The literal answer is that you should use an object of whatever class
delegateis 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?