Post

Replies

Boosts

Views

Activity

Reply to About how to storage NSAttributedString with sqlite3 and how to convert it
I get thisT{ NSColor = "UIExtendedGrayColorSpace 0 1"; NSFont = "<UICTFont: 0x7ff266520700> font-family: \".SFUI-Regular\"; font-weight: normal; font-style: normal; font-size: 22.00pt"; NSOriginalFont = "<UICTFont: 0x7ff266509e40> font-family: \"Helvetica\"; font-weight: normal; font-style: normal; font-size: 12.00pt"; NSParagraphStyle = "Alignment 4, LineSpacing 0, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection 0, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0 LineBreakStrategy 0";}ttt{ NSColor = "UIExtendedGrayColorSpace 0 1"; NSFont = "<UICTFont: 0x7ff266520700> font-family: \".SFUI-Regular\"; font-weight: normal; font-style: normal; font-size: 22.00pt"; NSParagraphStyle = "Alignment 4, LineSpacing 0, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection 0, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0 LineBreakStrategy 0";}Rruuoo{ NSColor = "UIExtendedGrayColorSpace 0 1"; NSFont = "<UICTFont: 0x7ff26672fa20> font-family: \".SFUI-Regular\"; font-weight: normal; font-style: normal; font-size: 14.00pt"; NSParagraphStyle = "Alignment 4, LineSpacing 0, ParagraphSpacing 0, ParagraphSpacingBefore 0, HeadIndent 0, TailIndent 0, FirstLineHeadIndent 0, LineHeight 0/0, LineHeightMultiple 0, LineBreakMode 0, Tabs (\n 28L,\n 56L,\n 84L,\n 112L,\n 140L,\n 168L,\n 196L,\n 224L,\n 252L,\n 280L,\n 308L,\n 336L\n), DefaultTabInterval 0, Blocks (\n), Lists (\n), BaseWritingDirection 0, HyphenationFactor 0, TighteningForTruncation NO, HeaderLevel 0 LineBreakStrategy 0";}{ NSFont = "<UICTFont: 0x7fec72f0c810> font-family: \".SFUI-Regular\"; font-weight: normal; font-style: normal; font-size: 12.00pt";}
Apr ’20
Reply to About how to storage NSAttributedString with sqlite3 and how to convert it
yes, I used UITextView to create a rich text demo, used NSAttributedString add some attributes, it's done well, but I want to save the data with attributes. so I used sqlite3 blob to storage the data, query data from table return NSData, then I used the above code to convert NSData to NSAttributedString. run the app, the string is shown in UITextView on the simulator. so How to solve it? thans a lot.
Apr ’20
Reply to About how to storage NSAttributedString with sqlite3 and how to convert it
I used below code to get data from db. func queryTable() -> [NSData] { var stmt:OpaquePointer? = nil let sql = "SELECT note_content FROM note_table" let csql = (sql.cString(using: String.Encoding.utf8)) var rows = [NSData]() if sqlite3_prepare(db, csql, -1, &stmt, nil) == SQLITE_OK{ while sqlite3_step(stmt) == SQLITE_ROW { let data = sqlite3_column_blob(stmt, 0) let size = sqlite3_column_bytes(stmt, 0) let val = NSData(bytes: data!, length: Int(size)) rows.append(val) } }else{ print("SQLITE_ERROR") } return rows }
Apr ’20
Reply to WatchConnectivity not working on device
I'm also facing the same issue :( I use  iOS system version to 14.6, watch os version to 7.5 In my project, I use WatchConnectivity between phone and watch to communication, When watch send message without reply to phone, every time is OK. But when need reply from phone, it's wrong. func session(_ session: WCSession, didReceiveMessage message: [String : Any], replyHandler: @escaping ([String : Any]) -> Void) { // replyHandler(reply) } when debug the code, I can see this func was called, but watch not receive reply. I try to edit scheme then switch debug to release, run the project. but failed. Is there any ideas?
Jun ’21