I am assuming you havent synthesized the property and the custom setter you defined is all that gets called...If thats the fact, then you are actually OVER releasing your string because you are not retaining your property
NSString *strA = [[NSstring alloc] initWithString:@"test string"]; //string with +1 ref
ClassB *classB = [[ClassB alloc] init];
[classB setStrB:strA]; //doesnt increase the ref count
[strA release]; //string with 0 ref count (which means OS will reclaim the memory allocated for the string)
now if you try to access classB strB property you will probably have a crash due to over release
If you were to retain the string in the setter, then yes you should release it in classB dealloc. But actually you have to be careful the way you write your setter (you should probably just synthesize and let the property be generated for you), here is how the setter should actually look like
-(void)setStrb:(NSString*)a
{
if(strB)
[strB release];
if(a==nil)
strB=nil;
else
strB=[a retain];
}
Here you are releasing strB if it isnt nil before you actually set it, it checks to see if a is nil in which case you just set strB to nil, else you set strB to a and retain
Hope this helps