ios - Assigning variable with return value -


i new ios, if @ following code, expect both x , y "hello"

- (void)viewdidload {     [super viewdidload];       nsstring  *x,*y;       y=    [x getstring];    }//viewdidload  -(nsstring *)getstring{       return @"hello";  } 

yet, error: no visible @interface nsstring declares selector 'getstring'

i tried many things, defined getstring in .h file

your x variable type on nsstring ant there no method getstring defined there.

i believe want call [self getstring] instead:

y =  [self getstring]; 

Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -