0
나는 내 애플 리케이션에서 일하고 있지만 도움이 필요해. Objective C에서 'PHP와 유사한 세션'이 필요합니다 (인터넷에 연결하지 않고) 글로벌 변수에 대해 생각해 보았지만, 내 앱은보기를 다시로드 할 때 재설정되었습니다. 이 내 현재 코드전역 변수 또는 세션을 좋아하는 PHP를
SecondViewController.h
@interface SecondViewController : UIViewController
{
NSString * string;
}
SecondViewController.m
@interface SecondViewController()
@end
@implementation SecondViewController
- (void)viewDidLoad
{
[super viewDidLoad];
if (! [string isEqualToString:@"Hello"])
{
NSLog(@"Hello");
string = @"Hello";
}
else
{
NSLog(@"Bye");
}
}
@end
입니다하지만 매번 내가 SecondViewController '문자열이'디폴트 값으로 reseted되어 다시로드합니다. 나는 PHP에서 사용하는 것을 찾고있다. (a.e. $ _SESSION [ 'string'] = 'hello')
해결책 : Maarten1909를 얻었습니까? – user247