profile
viewpoint
M了个J CoderMJLee 小码哥 http://www.520it.com Guangzhou, China https://www.cnblogs.com/mjios CEO of The Seemygo.

CoderMJLee/MJRefresh 13083

An easy way to use pull-to-refresh.

CoderMJLee/MJExtension 8226

A fast, convenient and nonintrusive conversion framework between JSON and model. Your model class doesn't need to extend any base class. You don't need to modify any model file.

kakaopensource/KakaJSON 579

Fast conversion between JSON and model in Swift.

CoderMJLee/mjcript 477

【越狱-逆向】基于Cycript实现的一些实用函数

CoderMJLee/MJAppTools 390

【越狱-逆向】处理iOS APP信息的命令行工具

CoderMJLee/MJCodeObfuscation 359

一个用于代码混淆和字符串加密的Mac小Demo

CoderMJLee/MJDownload 342

A delightful framework for multifile resumable broken downloads.

CoderMJLee/iOS9Sample-Photos 306

介绍Photos.framework的常见功能:创建自定义相册、保存图片到自定义相册、搜索所有相册的图片

CoderMJLee/BinaryTrees 125

Some operations for binary tree

CoderMJLee/Mems 95

Utils for viewing memory in Swift.

issue closedkakaopensource/KakaJSON

嵌套解析出错

模型

struct ChatRoomModel: Convertible {    
     var lastMessage: String = ""
     var lastMessageTime: NSNumber = 0
     var pkid: NSNumber = 0
     var unreadNoticeCount: NSNumber = 0

}
struct WorkShopsModel: Convertible {   
    var chatRoom:   ChatRoomModel?
    var imgUrl:     String = ""
    var isMine:     NSNumber = false
    var pkid:       NSNumber = 0
    var unsignined: NSNumber?
    var status:     NSNumber = 0
    var title:      String = ""
    var regCount:   Int?
    var tbString:   String?
    var teString:   String?

}

数据

            let json  =
                        """
                        {
                    "chatRoom": {
                        "dataSourceName": "x",
                        "last_message": "",
                        "last_message_time": 1567578912000,
                        "pkid": 2,
                        "unread_notice_count": 0
                    },
                    "dataSourceName": "x",
                    "img_url": "",
                    "is_mine": true,
                    "pk_chatroom": 2,
                    "pkid": 3,
                    "reg_count": 1,
                    "status": 1,
                    "tbString": "2019-01-30",
                    "teString": "2019-09-28",
                    "title": "",
                    "unsignined": true
                }
                """

chatRoom 字段解析出来是 nil

closed time in a month

MyTimeforDevIos

issue commentkakaopensource/KakaJSON

嵌套解析出错

不好意思,最近比较忙,刚看到问题

问题所在:因为设置了全局转下划线,遇到chatRoom、tbString,会去字典中查找chat_room、tb_string,所以转换失败

解决方案:如果chat_room、tb_string不存在,会利用chatRoom、tbString重新去字典中查找

最新的1.1.2版本已经增加这个功能

MyTimeforDevIos

comment created time in a month

push eventkakaopensource/KakaJSON

M了个J

commit sha 88d8587a90b8efaac9228baee3a759c25f8a6dd3

fixed issue 39

view details

push time in a month

release kakaopensource/KakaJSON

1.1.2

released time in a month

created tagkakaopensource/KakaJSON

tag1.1.2

Fast conversion between JSON and model in Swift.

created time in a month

issue commentkakaopensource/KakaJSON

Error verifying ipa package

问题解决了不?

WGFcode

comment created time in a month

issue closedkakaopensource/KakaJSON

建议引入头文件,方便工程引用

由于没有头文件,在用到KakaJSON的文件中都需要import一次

closed time in a month

WGFcode

issue closedkakaopensource/KakaJSON

混编项目闪退

model继承OC, 会闪退 image image

closed time in 2 months

chenjiangui

issue commentkakaopensource/KakaJSON

混编项目闪退

看了下Demo,找到问题所在了。KakaJSON目前是基于Swift的metadata进行解析的,OC的Model需要基于Runtime去解析,所以KakaJSON目前不支持纯OC的Model。如果你的Swift Model是直接继承NSObject,KakaJSON还是支持的。 目前的解决方案:使用基于Runtime的字典模型框架去解析OC的Model

chenjiangui

comment created time in 2 months

issue closedkakaopensource/KakaJSON

归档太耗性能

有的时候,归档处理不好,,非常影响性能,什么时候能上数据库,谢谢

closed time in 2 months

biancheng347

issue commentkakaopensource/KakaJSON

归档太耗性能

看看几时对接SQLite

biancheng347

comment created time in 2 months

push eventCoderMJLee/MJRefresh

Frank

commit sha 763dc2b5dc7106b208dfc0adacbd51dad1806876

修复AutoFooter 在 scrollView 打开 page 模式时, 则会变成和回弹 Footer 一样, 需要回弹. 加入回弹逻辑

view details

M了个J

commit sha 54a841b312a473ff72d43b8aac1b726173566fa5

Merge pull request #1304 from CoderMJLee/fix/state-of-autoFooter-is-not-correct-when-scrollView_s-pageEnabled 修复AutoFooter 在 scrollView 打开 page 模式时, 则会变成和回弹 Footer 一样, 需要回弹. 加入回弹逻辑

view details

push time in 3 months

push eventCoderMJLee/MJRefresh

Frank

commit sha 86ea62206f704aacbb309b859fe55e820c3e04f5

Support attributed text width calculation for UILabel

view details

M了个J

commit sha cf447abd32c4133b9327384ffc965b8be78741c7

Merge pull request #1376 from CoderMJLee/enhancement/support-attributed-text-width-calculation-for-UILabel Support attributed text width calculation for UILabel

view details

push time in 3 months

issue closedkakaopensource/KakaJSON

使用了KaKaJSON还有必要使用swiftjson吗

没有出KaKaJSON之前项目中使用了swiftjson,现在使用了KaKaJSON 和之前引入的swiftjson有冲突.请问我可以去掉swiftjson吗还是怎么处理,谢谢

closed time in 3 months

lxlnihao

issue commentkakaopensource/KakaJSON

混编项目闪退

可以给个Demo不

chenjiangui

comment created time in 3 months

issue commentkakaopensource/KakaJSON

关于JSONObject

func kj_JSONKey(from property: Property) -> JSONPropertyKey

参考【KakaJSON手册】06_Model转JSON

MuRanJiangXia

comment created time in 3 months

push eventCoderMJLee/BinaryTrees

M了个J

commit sha 0cc48e673aa0ac7288a4e1249d65d9d38b703440

Update README.md

view details

push time in 3 months

issue closedkakaopensource/KakaJSON

手动导入KaKaJSON库提示修改

你好,我导入库之后提示我这个 1572516939093 可以根据提示改成叹号吗

closed time in 3 months

lxlnihao

issue commentkakaopensource/KakaJSON

使用了KaKaJSON还有必要使用swiftjson吗

建议使用别的方式集成第三方库,这样可以模块化管理。不建议直接将库的代码拽入项目中

lxlnihao

comment created time in 3 months

issue closedkakaopensource/KakaJSON

release 模式下取不出模型里的 Int类型的值

模型

struct BookResource: Convertible {
    enum ResourceType {
        case picture
        case pictureFllowRead
        case video
        case audio
        case demo
        case test
        case weike
        case unkown
    }
    let rID: Int = 0
    let rName: String = ""
    let ext: String = ""
    let showNum: Int = 0
    let fileType: Int = 0
    let chapterID: Int = 9991
    let sectionID: Int = 0
    let downloadPath: String = ""
    let ossName: String = ""
    let picOption: Int = 0
    let imgType: Int = 0
    let fundamentalTone: String = ""
    var type: ResourceType {
        switch picOption {
        case 1:
            if imgType == 1 {
                return .pictureFllowRead
            }
            else {
                return .picture
            }
        case 2:
            return .demo
        case 3:
            return .test
        case 4:
            return .video
        case 5:
            return .audio
        case 6:
            return .weike
        default:
            return .unkown
        }
    }
    func kj_modelKey(from property: Property) -> ModelPropertyKey {
        switch property.name {
        case "rID": return "r_id"
        case "rName": return "r_name"
        case "showNum": return "show_num"
        case "chapterID": return "chapter_id"
        case "sectionID": return "section_id"
        case "imgType": return "img_type"
        case "fundamentalTone": return "fundamental_tone"
        default:
            return property.name
        }
    }
   
}

在这里用的, 我把打印复制到里边了

static func save(bookID: Int, resource: BookResource) {
        dbQueue.inDatabase { db in
            let sql: String = """
            INSERT OR REPLACE INTO t_resource (user_id, book_id, chapter_id, section_id, r_id, r_name, ext, show_num, fileType, downloadPath, ossName, picOption, img_type, fundamental_tone) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
            """
            let resource = resource
            print("resource: \(resource)")
/*            
 resource: BookResource(rID: 984, rName: "situational prompts", ext: "html", showNum: 1, fileType: 2, chapterID: 58, sectionID: 212, downloadPath: "http://114.116.28.196:9003/wap/getSectionContent_984.html", ossName: "getSectionContent_984", picOption: 2, imgType: 0, fundamentalTone: "")
*/

            let resourceID: Int = resource.rID
            
            print("resource.rID: \(resource.rID)")
            print("resourceID: \(resourceID)")
/*
            resource.rID: 0
resourceID: 0
*/

            let arguments: StatementArguments = [userID, bookID, resource.chapterID, resource.sectionID, resourceID, resource.rName, resource.ext, resource.showNum, resource.fileType, resource.downloadPath, resource.ossName, resource.picOption, resource.imgType, resource.fundamentalTone]
            
            print("arguments: \(arguments)")
/*
arguments: [100764, 200121, 9991, 0, 0, "situational prompts", "html", 0, 0, "http://114.116.28.196:9003/wap/getSectionContent_984.html", "getSectionContent_984", 0, 0, ""]
*/
            do {
                try db.execute(sql: sql, arguments: arguments)
            } catch {
                debugLog("save a book resource, 操作异常, error: \(error)")
            }
        }
    }

控制台, 可以把值 po 出来 (lldb) po resource.rID 984

(lldb) po resourceID 0

chapterID, 在使用的时候就是默认值 9991 let chapterID: Int = 9991

closed time in 3 months

flyuqian

issue commentkakaopensource/KakaJSON

使用了KaKaJSON还有必要使用swiftjson吗

@mg459046365 就是在对JSON进行类型转换(as)、取值方面(JSON[key])可以简化一点,不过也简化不了多少,毕竟稍微从JSON中取两下东西就转成模型了,后续都不会直接操作JSON了

lxlnihao

comment created time in 3 months

issue closedCoderMJLee/Mems

Can't work in Xcode 10.3

public protocol MemsCompatible {}
public extension MemsCompatible {
    static var mems: MemsWrapper<Self>.Type {
        get { MemsWrapper<Self>.self }
        set {}
    }
    var mems: MemsWrapper<Self> {
        get { MemsWrapper(self) }
        set {}
    }
}

get 里面省略 returnSwift 5.1 的特性,在 Swift 5 里面会报错

closed time in 3 months

RayJiang16

issue commentCoderMJLee/Mems

Can't work in Xcode 10.3

更新了

RayJiang16

comment created time in 3 months

issue commentkakaopensource/KakaJSON

iOS 9 Crash

@shaop @huhaosanxiong 1.1.1版本已经修复

shaop

comment created time in 4 months

release kakaopensource/KakaJSON

1.1.1

released time in 4 months

created tagkakaopensource/KakaJSON

tag1.1.1

Fast conversion between JSON and model in Swift.

created time in 4 months

push eventkakaopensource/KakaJSON

M了个J

commit sha 331c815490688e80a3a5fa0f1c28a271f857df71

Adjust lock

view details

push time in 4 months

delete tag kakaopensource/KakaJSON

delete tag : 1.1.1

delete time in 4 months

release kakaopensource/KakaJSON

1.1.1

released time in 4 months

created tagkakaopensource/KakaJSON

tag1.1.1

Fast conversion between JSON and model in Swift.

created time in 4 months

push eventkakaopensource/KakaJSON

M了个J

commit sha 12e719125fff25c31741693ca1bad13862db1f58

Fix for iOS9

view details

push time in 4 months

push eventCoderMJLee/Mems

M了个J

commit sha 0a3e0b309d1a2c144a67dfce3572cbcaea5ef001

Support Swift 5.0

view details

push time in 4 months

issue commentkakaopensource/KakaJSON

使用了KaKaJSON还有必要使用swiftjson吗

再补充一点哈,如果你的项目中都是直接将服务器返回的JSON转成模型来用,不会直接用字典,是可以不使用SwiftyJSON的,但我认为用了SwiftyJSON会更方便

lxlnihao

comment created time in 4 months

issue commentkakaopensource/KakaJSON

使用了KaKaJSON还有必要使用swiftjson吗

  • 冲突在什么地方?
    • 目前KakaJSON用到的类型名称是有特地避开SwiftyJSON的
    • 你用的是最新版代码么?
    • SwiftyJSON和KakaJSON是可以一起使用的
  • 第二份代码没看懂哈,是想表达什么呢?
lxlnihao

comment created time in 4 months

issue commentkakaopensource/KakaJSON

手动导入KaKaJSON库提示修改

你的环境是Xcode几?

lxlnihao

comment created time in 4 months

issue commentkakaopensource/KakaJSON

iOS 9 Crash

@shaop 你加上name == "_TtCs12_SwiftObject"判断之后是否有效?

shaop

comment created time in 4 months

push eventCoderMJLee/MJExtension

kinarob

commit sha fc0ba349e6c5c040aacf7ba8b14cc7b5fe0ca9b6

fix decimal number transform to bool bug

view details

M了个J

commit sha bb9aca2c879add8faed446f328e3b81ca847b112

Merge pull request #726 from kinarobin/fix_decimal_number_transform_to_bool_bug Fix decimal number transform to bool bug

view details

push time in 5 months

push eventkakaopensource/KakaJSON

M了个J

commit sha 6eeee41578c1aa15785c326a6ead4bec4314ad18

Update README.md

view details

push time in 5 months

issue commentkakaopensource/KakaJSON

Key path matched wrong value

luoxiu

comment created time in 5 months

issue commentkakaopensource/KakaJSON

Key path matched wrong value

Use teams.0.name instead of ["teams", "0", "name"] in the situation?

luoxiu

comment created time in 5 months

push eventkakaopensource/KakaJSON

M了个J

commit sha cb6270b554181dbb41eb837407e835de2cb52d83

Update MD

view details

push time in 5 months

push eventkakaopensource/KakaJSON

Luo Xiu

commit sha 41399f815608b826753f3ba0284bb4c8cf508a2a

use spm project struct template

view details

Luo Xiu

commit sha 83ec351ee93bdbcb514df2f27cbb87f53bebde1e

fix podspec source path

view details

Luo Xiu

commit sha 9e1cd4c3d0c231ac29446c95439506ac7b60bb72

add deployment group for package manager configurations

view details

Luo Xiu

commit sha fcccf63b62313c560fafb776c40888c35768623a

Add Development group, contains `CHANGELOG` and `DevGuideline`

view details

Luo Xiu

commit sha 571569f2fb53d4af04e462d78a151b9a71cdb4cf

Add demo project

view details

Luo Xiu

commit sha 4d2483da832b3c09ec4b203f768223adc5ddc6e6

add travis

view details

Quentin Jin

commit sha 15f929a6db7f335b2b1316931c6c15769849144d

expose tests for spm

view details

Quentin Jin

commit sha 76480b53d86c38fb5e26778b77d0eaaa6401e152

fix travis

view details

Quentin Jin

commit sha 70c04a7e35ed938270e2c1b2670d03ebab3aee8c

disable linux for now

view details

Quentin Jin

commit sha 95338eba99f20a25a8d7377ab86655b74591523e

revert DevGuideline

view details

Quentin Jin

commit sha a31f26b1b0a98355e5eda4bf077de3077e6b6ebb

expose all tests for linux

view details

M了个J

commit sha 07cdb0121f5ad6de03e46ccd230e5d438a20110c

Merge pull request #27 from luoxiu/refactor-project-structure [big pr]: refactor project structure

view details

push time in 5 months

PR merged kakaopensource/KakaJSON

[big pr]: refactor project structure

resolve #26 Big pr,但大部分修改是移动文件。

这个 pr 主要修改了:

  1. 使用了 SwiftPM 生成的 project 模版。
  2. Carthage 现在支持了 macOS/tvOS/watchOS。
  3. Package.swift 添加了 test target,现在可以使用 swift test 快速测试了。
  4. Expose allTests to linux.
  5. 添加了 .travis.yml,现在 matrix 有 mac, iphone, appletv.

KakaJSON 的依赖只有 Foundation,支持 Linux 应该是顺理成章的,但这行代码在 Cocoa 上通过了编译,在 Linux 上却编译失败:

extension NSObject {
    static func newConvertible() -> Convertible {
        return self.init() as! Convertible  // Error: constructing an object of class type 'NSObject' with a metatype value must use a 'required' initializerinitializer
    }
}

所以暂时把 travis 里的 Linux 注释掉了。

+1673 -1132

1 comment

95 changed files

luoxiu

pr closed time in 5 months

issue closedkakaopensource/KakaJSON

重构项目结构

现在的 KakaJSON 只有 cocoa touch framework 的 scheme,这会让在 macOS app 里使用 Carthage 添加依赖时会找不到对应 scheme 编译。(在 CocoaPods 下没有问题)

需要组织下项目结构: ——可以直接用 spm 重新生成支持多平台的 xcodeproj(建议)。 ——也可以手动添加新的 macOS&tvOS schemes。

如果愿意的话我可以提交一个 pr~ 🍻

closed time in 5 months

luoxiu

push eventCoderMJLee/MJRefresh

Frank

commit sha 25ea802e3a0bb198866027e3bead6c3dce0e990e

新增 Swift Optionals 支持

view details

Frank

commit sha 248d9fedbcd840b62e9c74a3c9452e96e6994e54

repair the warning for nil value

view details

M了个J

commit sha 4287a4f6b48115a82b68375536367b3f91b45cf5

Merge pull request #1338 from wolfcon/enhancement/support-swift-optionals 新增 Swift Optionals 支持

view details

push time in 5 months

more