nsstring

    1熱度

    2回答

    我想在NSString中的一組字符前添加特定字符。 例如: NSString *input = @"abc^ 123 # //> <"; NSString *insertBefore = @"~"; NSCharacterSet *needBeInserted = [NSCharacterSet characterSetWithCharactersInString:@"~

    3熱度

    1回答

    爲什麼我們無法在32位設備(iPhone5,iPhone4s或其模擬器)中使用「%zd」預期格式化字符串? int64_t test1 = 11111111; int64_t test2 = 22222222; int64_t test3 = 33333333; int64_t test4 = 44444444; NSString *testStr = [NSString stringWi

    0熱度

    2回答

    我想以後「\」得到的字符串值的字符串?

    0熱度

    1回答

    我遇到了問題swift String,任何人都可以幫助我嗎? 我知道我可以使用String.Index得到一個子 let country = "德國 Germany" let flag3 = country[country.index(country.startIndex, offsetBy: 1)..<country.index(country.startIndex, offsetBy: 3)

    -4熱度

    3回答

    在viewDidLoad中()我有: let text = textField.text! as NSString doneButton.isEnabled = (text.count > 0) 我得到錯誤: 類型的值的NSString沒有成員「計數' 我不明白,因爲之前迅速4它是characters.count,現在在其迅速4它直接宣佈.count,我得到這個錯誤。 有人嗎? 在此先感謝您

    0熱度

    2回答

    我在將NSString轉換爲NSUrl時出現了一個奇怪的問題。其實我有一個方法,它將NSString作爲參數,然後將其轉換爲NSUrl,然後使用該URL來下載文件。 當我通過傳遞url作爲字符串通過我的代碼調用此方法時,下面一行返回nil。 NSURL *url = [NSURL URLWithString:urlString]; 但是,當我硬編碼相同的方法中的字符串,然後我的字符串轉換爲NS

    0熱度

    3回答

    我有一個macOS應用程序。我需要刪除任何NSURL的方案和www部分。這是我想出了: // For testing purposes. NSString *blogID = @"https://www.testing1234.tumblr.com"; // Create the corrected link string. NSString *correctLink; // Conv

    0熱度

    1回答

    我讀通過使用證書信息 NSString *summary = CFBridgingRelease(SecCertificateCopySubjectSummary(cert)); 其獲得證書總之,當總結是中國人,如中,總結回報ä¸ 我怎麼能編碼ä¸至中是否正確? 我如何獲得證書摘要代碼 CFMutableDictionaryRef query = CFDictionaryCreateMutab

    0熱度

    2回答

    繪製透明文本我用下面的代碼畫上NSImage.How一個NSString我可以讓這個文本透明 text.draw(at: NSZeroPoint, withAttributes: [NSFontAttributeName: font, NSForegroundColorAttributeName: NSColor.white]) 我怎樣才能讓這個文本透明? 請指點

    2熱度

    1回答

    NSString * str1 = @"haha"; NSString * str2 = [str1 copy]; str1 = @"laa"; NSLog(@"str1的地址爲:%p", str1); NSLog(@"str2的地址爲:%p", str2); NSLog(@"str1的值爲:%@", str1); NSLog(@"str