0
我似乎遇到了編碼問題。Objective C字符串編碼
我有以下代碼:
// Sets the server url and whether or not the server is logged in
- (Server *) init:(NSString *) url {
// Setup the singleton!
_instance = self;
// Store our own copy of the string
self.serverUrl = [[NSString alloc] initWithString:url];
self.is_logged = NO;
NSLog(@"Given: %s Current: %s Should BE: %s", url, self.serverUrl, @"http://clanware.com:8000/api");
return self;
}
`
的對象實例如下:
self.server = [[Server alloc] init:@"http://clanware.com:8000/api"];
NSLog(@"URL in Server: %s", self.server.serverUrl);
我得到在gdb下面的輸出(我在運行此xcode)
[Session started at 2010-12-02 11:55:35 -0400.]
2010-12-02 11:55:40.388 ProjectPrototype[1765:207] Given: `üô» Current: `üô» Should BE: `üô»
2010-12-02 11:55:40.390 ProjectPrototype[1765:207] URL in Server: `üô»
任何幫助將不勝感激,我迷路了,我不知道該怎麼辦!
非常感謝=)
非常感謝這個完美! – 2010-12-02 16:06:26