哪种编程语言的语法是这样的(Swift或Objective C)
问题描述:
我想将我的游戏从Android(Java)移植到IOS。我正在使用谷歌的实时多人游戏服务。他们在他们的网站上提供示例应用程序。哪种编程语言的语法是这样的(Swift或Objective C)
这是哪种编程语言? Swift还是Objective C?代码google developers。
短摘自链接:
- (void)room:(GPGRealTimeRoom *)room didChangeStatus:(GPGRealTimeRoomStatus)status {
if (status == GPGRealTimeRoomStatusDeleted) {
NSLog(@"RoomStatusDeleted");
[self.lobbyDelegate multiPlayerGameWasCanceled];
_roomToTrack = nil;
} else if (status == GPGRealTimeRoomStatusConnecting) {
NSLog(@"RoomStatusConnecting");
} else if (status == GPGRealTimeRoomStatusActive) {
NSLog(@"RoomStatusActive! Game is ready to go");
_roomToTrack = room;
// We may have a view controller up on screen if we're using the
// invite UI
[self.lobbyDelegate readyToStartMultiPlayerGame];
} else if (status == GPGRealTimeRoomStatusAutoMatching) {
NSLog(@"RoomStatusAutoMatching! Waiting for auto-matching to take place");
_roomToTrack = room;
} else if (status == GPGRealTimeRoomStatusInviting) {
NSLog(@"RoomStatusInviting! Waiting for invites to get accepted");
} else {
NSLog(@"Unknown room status %ld", status);
}
}
提前感谢!
答
这是Objective-C。
In objective-c []
用于消息传递(方法调用)。
在swift语法用于消息传递(方法调用)。
Objective-C它是!顺便说一句,不是一个适当的地方问这个问题。 –