GithubHelp home page GithubHelp logo

启动时崩溃 about godeye HOT 4 CLOSED

zixun avatar zixun commented on September 24, 2024
启动时崩溃

from godeye.

Comments (4)

zixun avatar zixun commented on September 24, 2024 1

print不会走asl的,只有NSLog()才会走ASL,并且在Swift工程下,NSLog()只有在模拟器上才会走ASL,OC的话真机也会,算是Swift对性能的优化。因此我封装了一个Log4G的库来做日志记录,可以参考CocoaChinaPlus,关于日志监控的所有实现和坑我都写在了《iOS监控编程》里,其中日志相关的是可以试读的

from godeye.

zixun avatar zixun commented on September 24, 2024

貌似是因为你的json数据有问题,试试在

let data = try JSONSerialization.data(withJSONObject: returnValue)

前面加一行:

guard JSONSerialization.isValidJSONObject(returnValue) else {
       return nil;
 }

看看有啥效果

等待你的回复

from godeye.

gyzerocc avatar gyzerocc commented on September 24, 2024

嗯,加上这句代码后不会发生崩溃了!

我能问个问题吗?swift怎样输出ASL?我使用print()发现不行。。

from godeye.

gyzerocc avatar gyzerocc commented on September 24, 2024

原来如此,谢谢哈

from godeye.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.