我有一个应用程序,我试图将字符串从一个视图控制器发送到另一个视图控制器。当字符串没有空格时,一切正常。如果他们确实有空间,那么应用程序就会因内存泄漏而崩溃。这就是我的做法:
RegisterViewController2 *register2viewcontroller = [[RegisterViewController2 alloc] initWithNibName:@"RegisterViewController2" bundle:nil];
register2viewcontroller.username2=[usernamestring retain];
register2viewcontroller.email2=[emailstring retain];
register2viewcontroller.password2=[passwordstring retain];
register2viewcontroller.date=[agestring retain];
register2viewcontroller.gender2=[gendustring retain];
register2viewcontroller.occupation2=[occustring retain];
[self.navigationController pushViewController:register2viewcontroller animated:YES];
username2 和 usernamestrings 是具有非原子性和强属性的类变量。有谁能够帮我?