GithubHelp home page GithubHelp logo

ziwen / firefox-ios Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mozilla-mobile/firefox-ios

0.0 0.0 0.0 130.13 MB

Firefox for iOS

License: Mozilla Public License 2.0

Objective-C 1.54% Swift 20.59% HTML 0.57% JavaScript 0.43% CSS 0.18% Python 0.84% C 70.99% C++ 4.81% Ruby 0.01% Shell 0.05%

firefox-ios's Introduction

#Objective-C Debug 学习

子文的博客

苹果xcode图标 只会写代码的程序员不是好程序员,程序员是一个从制造bug到解决bug的死循环中不断成长,

NSLog(@"Founction:%s\n Pretty founction:%s\n Line:%d\n File:%s\n Object:%@",__func__,__PRETTY_FUNCTION__, __LINE__, __FILE__, self );

输出结果

2015-03-11 15:33:20.316 ssss[4080:184167] 
 Founction:-[AppDelegate application:didFinishLaunchingWithOptions:]
 Pretty founction:-[AppDelegate application:didFinishLaunchingWithOptions:]
 Line:19
 File:/Users/ziwen/Desktop/artical/ssss/ssss/AppDelegate.m
 Object:<AppDelegate: 0x7f8beb416980>

上述结果原因是 func, PRETTY_FUNCTION, LINE, __FILE__等都是系统预留的定义词,简单易用。

同时还有一些系统方法可以从CFString 转换为NSString。包括且不限于selector,class,protocol等,参考下面的代码:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
NSLog(@"Current selector: %@", NSStringFromSelector(_cmd));
NSLog(@"Filename: %@", [[NSString stringWithUTF8String:__FILE__] lastPathComponent]);
NSLog(@"object class:%@",NSStringFromClass([self class]));
return YES;
}

输出结果如下:

2015-03-11 15:38:10.034 ssss[4104:186832] Current selector: application:didFinishLaunchingWithOptions:
2015-03-11 15:38:10.034 ssss[4104:186832] Filename: AppDelegate.m
2015-03-11 15:38:10.034 ssss[4104:186832] object class:AppDelegate

通过拿到字符串做一些其他操作,是不是很hi,duang,duang。

firefox-ios's People

Contributors

aaronmt avatar aaronraimist avatar ackratos avatar allenngn avatar apbendi avatar atulagrwl avatar bkmunar avatar codestergit avatar darrinhenein avatar dusek avatar flodolo avatar jchhikara avatar jhugman avatar johennes avatar kar1m avatar kylenoble avatar matthewpurcell avatar mralext20 avatar mzp avatar ncalexan avatar palewar avatar rnewman avatar sachin004 avatar splewako avatar st3fan avatar thebnich avatar tomacpace avatar vladikoff avatar wesj avatar xusader avatar

Watchers

 avatar  avatar

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.