nsstring

    0熱度

    1回答

    我想將一些信息保存到視頻元數據中。現在我可以保存文本,即String對象。 // this works well let metaItem = AVMutableMetadataItem() metaItem.key = AVMetadataCommonKeySource as NSCopying & NSObjectProtocol metaItem.keySpace = AVMetada

    0熱度

    1回答

    正常工作 蘋果公司NSString.appendingPathComponent(_:)的文檔描述: 的方法將按預期在MacOS但沒有在Linux上。有什麼解決方法嗎?這是一個功能還是錯誤?我們可以在哪裏報告? Run online import Foundation extension String { func appendingPathComponent(_ str: Str

    0熱度

    1回答

    的正則表達式匹配序列我有一個測試字符串,如:The Sun and the Moon together, forever 我希望能夠鍵入幾個字符或單詞,並能如果字符出現在正確的順序在一起來匹配這個字符串,即使有遺漏的話。例如,下面的搜索詞(或多個)都應該對陣這個字符串: The Moon Sun tog Tsmoon The get ever 什麼正則表達式,我應該使用嗎?我應該補充一點,提供的測

    0熱度

    3回答

    的我試圖使用類屬性下面這個example。但是我收到以下錯誤:「使用未清除的標識符'_myProperty'」。 這是我實現: @interface myClass() @property (class,strong,nonatomic) NSString *myProperty; @end + (NSString*)myProperty { if (!_myProper

    0熱度

    1回答

    我必須從數據庫中解析10K條目。 該數據庫有一個名爲工作小時的字段,顯示了汽車經銷商的辦公室工作時間。 的問題是,這個字段包含描述性的東西是這樣的: Office working hours from 10 am - 4 pm Open from 9AM to 5PM Main Showroom from 10:00AM - 5:00PM Open 10 AM to 13 PM Offic

    0熱度

    1回答

    開啓此Stackoverflow post,這非常有幫助,我已經能夠成功地將文本繪製成全屏圖像,屏幕圖像(我標記的圖像與前罐頭,短字符串,例如,「回收站」)。但是,該文本並未出現在我想要的位置,而是以用戶點擊的確切位置爲中心。這裏是我的代碼的基礎上,從上面發佈一些代碼,但更新的Swift3 - func addTextToImage(text: NSString, inImage: UIImage

    0熱度

    1回答

    我有一個textview,用戶可以編輯,當我嘗試從textview插入文本到類型爲Nsstring的本地屬性,我得到了這個屬性NSMallocBlock。是什麼原因?謝謝! 這是cartItemComment的defintaion: @property (nonatomic, assign) NSString * cartItemComment; ,這是代碼: CartItem *cartIt

    0熱度

    1回答

    我使用以下代碼在數組中搜索在UISearchBar中鍵入的短語,然後添加該短語所在的索引的內容找到將顯示在表視圖中的數組。 -(void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)enteredSearchText{ if ([enteredSearchText length] == 0) {

    0熱度

    1回答

    我有一個String擴展名,我想在NSString上使用objective c。由於swift中的String是struct所以它沒有暴露於objective c。所以爲了從objective c中調用它,我在NSString上定義了一個extension在同一個文件中。 public extension NSString { func htmlAttributedStringWit

    0熱度

    1回答

    我有textField用戶輸入任何文本甚至不知道長度, 然後我必須將其轉換爲十六進制。我通過這個代碼完成了它。 NSString * str = @"Hello World"; NSString * hexStr = [NSString stringWithFormat:@"%@", [NSData dataWithBytes:[str cStringUsingEncoding