say for eg i have :
Test.h
Test.m
AnotherClass.m
So, why does < NSLog(tt->temp) > work?
Or is there something i am missing...
Thanks
amal
Test.h
Code:
@interface Test : NSObject
{
@public
NSString* temp;
}
-(id)init;
-(NSString*)giveMeRandomString;
@end
Test.m
Code:
@implementation Test
-(id)init
{
temp=@"temp";
return self;
}
-(NSString*)giveMeRandomString
{
return @"random";
}
@end
AnotherClass.m
Code:
@implementation AnotherClass
-(void)access
{
Test* t=[[Test alloc] init];
NSLog(t->temp); // ok
NSLog([t giveMeRandomString]); // ok
Test** tt=&t;
NSLog(tt->temp); // why such a access is permissible
NSLog(*tt->temp); // ok...should be this way and not like the above step
NSLog([tt giveMeRandomString]); // compiler error...alright
NSLog([*tt giveMeRandomString]); // ok
}
@end
So, why does < NSLog(tt->temp) > work?
Or is there something i am missing...
Thanks
amal