Better way to get the user's name from device?

前端 未结 6 1494
耶瑟儿~
耶瑟儿~ 2020-12-09 05:11

I made a function that extracts a user name from the device name.

The idea is to skip setup steps to allow the user to go straight to play

6条回答
  •  不知归路
    2020-12-09 05:37

    NSString *dname=[[UIDevice currentDevice] name];
    dname=[dname componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"'的"]][0];
    

提交回复
热议问题