nslog

iOS NSLog error with Unicode characters

假如想象 提交于 2020-01-21 07:20:28
问题 Can anyone tell me the cause of the discrepancy for the following results ? completionHandler:^(NSArray *placemarks, NSError *error) { NSLog(@"\n placemarks%@", placemarks); Resulting: placemarks( "\U039b\U03b5\U03c9\U03c6\U03cc\U03c1\U03bf\U03c2 \U039a\U03cd\U03c0\U03c1\U03bf\U03c5 163, 16451 \U0391\U03c1\U03b3\U03c5\U03c1\U03bf\U03cd\U03c0\U03bf\U03bb\U03b7\U03c2, \U0395\U03bb\U03bb\U03ac\U03c2 @ <+37.90085408,+23.75654648> +/- 100.00m, region (identifier <+37.90085408,+23.75654648> radius

iOS NSLog error with Unicode characters

别说谁变了你拦得住时间么 提交于 2020-01-21 07:20:07
问题 Can anyone tell me the cause of the discrepancy for the following results ? completionHandler:^(NSArray *placemarks, NSError *error) { NSLog(@"\n placemarks%@", placemarks); Resulting: placemarks( "\U039b\U03b5\U03c9\U03c6\U03cc\U03c1\U03bf\U03c2 \U039a\U03cd\U03c0\U03c1\U03bf\U03c5 163, 16451 \U0391\U03c1\U03b3\U03c5\U03c1\U03bf\U03cd\U03c0\U03bf\U03bb\U03b7\U03c2, \U0395\U03bb\U03bb\U03ac\U03c2 @ <+37.90085408,+23.75654648> +/- 100.00m, region (identifier <+37.90085408,+23.75654648> radius

iPhone console for nslog?

五迷三道 提交于 2020-01-14 05:01:05
问题 How can i see nslog messages when I am testing on device? My only way right now is to have a UITextView and put message in there, there must be a better way..Thanks. I went to seetings and turned on console but still don't know how to see them. Thanks. 回答1: These calls will output to your devices system log. You'll be able to get these from the XCode Organizer when you plug your phone back in. 回答2: There are also a few apps you can install from App Store on your device (search for free ones,

Is there a way to log all the property values of an Objective-C instance

爱⌒轻易说出口 提交于 2020-01-12 00:41:32
问题 I was just wondering if there is a quick and easy way of printing out to the log all of the various values of the properties to my class for debugging purposes. Like I would like to know what the values of all of the BOOLs, floats, etc. are. 回答1: This question seems the have the answer to your question. Update: I got curious and made a catagory: //Using Xcode 4.5.2 - iOS 6 - LLDB - Automatic Reference Counting //NSObject+logProperties.h @interface NSObject (logProperties) - (void)

iOS AutoLayout - get frame size width

◇◆丶佛笑我妖孽 提交于 2020-01-08 13:57:32
问题 I am developing using iOS 6 auto layout I would like to log a message displaying the frame width of the view. I can see the textView on the screen. But I get the width and height as zero, am I missing something ? NSLog(@"textView = %p", self.textView); NSLog(@"height = %f", self.textView.frame.size.height); NSLog(@"width = %f", self.textView.frame.size.width); textView = 0x882de00 height = 0.000000 width = 0.000000 回答1: I think auto layout hasn't had the time to layout your views by the time

iOS AutoLayout - get frame size width

感情迁移 提交于 2020-01-08 13:56:08
问题 I am developing using iOS 6 auto layout I would like to log a message displaying the frame width of the view. I can see the textView on the screen. But I get the width and height as zero, am I missing something ? NSLog(@"textView = %p", self.textView); NSLog(@"height = %f", self.textView.frame.size.height); NSLog(@"width = %f", self.textView.frame.size.width); textView = 0x882de00 height = 0.000000 width = 0.000000 回答1: I think auto layout hasn't had the time to layout your views by the time

Printing NSError by NSLog always raises EXE_BAD_ACCESS

你。 提交于 2020-01-02 18:05:51
问题 I have a code for retriving remote json file. I tried to print the error when the network is not available (turing on airplane mode on purpose to produce the error). But every time, it raised a EXE_BAD_ACCESS on the logging line My code is like this: NSURLConnection.sendAsynchronousRequest(request, queue: NSOperationQueue.mainQueue()){ (response: NSURLResponse?, data: NSData?, error: NSError?) -> Void in if(error != nil){ let errorDesc = error!.description ?? "" NSLog("HTTP request error = \

IOS数据持久化之归档NSKeyedArchiver

微笑、不失礼 提交于 2020-01-01 21:55:35
IOS数据持久化的方式分为三种: 属性列表 (自定义的Property List 、NSUserDefaults) 归档 (NSKeyedArchiver) 数据库 (SQLite、Core Data、第三方类库等)   下面主要来介绍一个 归档NSKeyedArchiver 。    归档(又名序列化),把对象转为字节码,以文件的形式存储到磁盘上;程序运行过程中或者当再次重写打开程序的时候,可以通过解归档(反序列化)还原这些对象。    归档方式: 对Foundation框架中对象进行归档 对自定义的内容进行归档 对自定义的对象进行归档 <一> 对Foundation框架中对象进行归档 //获得文件路径 NSString *documentPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]; NSString *filePath = [documentPath stringByAppendingPathComponent:@"file.archiver"]; //归档(序列化) NSArray *archiveAry = @[@"jereh",@"ios"]; if ([NSKeyedArchiver

Print NSMutableURLRequest Contents

。_饼干妹妹 提交于 2020-01-01 04:09:06
问题 I want to ask if anybody has ever tried printing out the values of a NSMutableURLRequest *request; Here's my scenario, I have formed my XML and tried sending it using Firefox Poster plugin, I am successful playing with valid and invalid contents, so its time to move into iOS, unfortunately with iOS it doesn't seem to work correctly tho I always get a response of Bad Request (400) which I suspect is caused by a malformed xml content; So I was thinking before sending the request I want to check

Creating multiple log files in iPhone app

一曲冷凌霜 提交于 2019-12-31 02:13:08
问题 I want to create two log files in my iPhone application. If I redirect the NSLog output to a file using freopen(), then all the log statements will go into one mentioned files. But I want to put some log statements into one file while some into different file. Any idea, how can I do that? 回答1: The best approach would be to write your own logger class as a drop in replacement that you use instead of NSLog(). That way you can easily determine in run-time which logs should be written to which