Michael Tsai - Blog - Dangerous NSLog() Calls in Swift
seen from United States
seen from United States

seen from Pakistan
seen from United Kingdom

seen from Malaysia
seen from United States

seen from Philippines
seen from China

seen from Malaysia
seen from China
seen from Pakistan
seen from China
seen from China

seen from United Kingdom
seen from United States
seen from United Kingdom

seen from United Kingdom
seen from China

seen from United States
seen from Malaysia
Michael Tsai - Blog - Dangerous NSLog() Calls in Swift

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Utilisez des points d'arrêt au lieu de NSLog
Vous avez probablement essayé de faire des flux logique de débogage ou d'inspecter le contenu des paramètres de votre méthode en ajoutant des déclarations NSLog et en re-compilant votre application. Il y a une façon beaucoup plus efficace et plus rapide de le faire en utilisant juste des points d'arrêt (Breakpoint). Il suffit d'ajouter un point d'arrêt à la ligne que vous auriez normalement ajouter une déclaration NSLog, puis clic droit. Vous devriez voir ceci: Maintenant, cliquez sur "Edit Breakpoint...", qui révèle une nouvelle popover, avec un tas d'options: Tout d'abord, activez la case à cocher «Automatically continue after evaluating" de sorte que vous ne soyez pas interrompu chaque fois que le contrôle de votre application atteint ce point. Cliquez ensuite sur "Add Action" et tapez "po" (ou p si elle est pas un objet) suivis par tout ce que vous avez essayé de NSLog. Lorsque votre commande atteint ce point, vous verrez votre commande en cours d'exécution, et sa sortie étant connecté à la console Xcode. Vous pouvez ajouter à votre débogage une étape supplémentaire en ajoutant une condition. Seulement lorsque la condition sera évaluée à true, elle exécutera votre commande.
How to: Warning: "format not a string literal and no format arguments"
How to: Warning: "format not a string literal and no format arguments"
Warning: "format not a string literal and no format arguments"
Since upgrading to the latest Xcode 3.2.1 and Snow Leopard, I’ve been getting the warning
“format not a string literal and no format arguments”
from the following code:
NSError *error = nil; if (![self.managedObjectContext save:&error]) { NSLog([NSString stringWithFormat:@"%@ %@, %@", errorMsgFormat, error, [error userInfo]]); }
If
View On WordPress
How to: What is the Objective-C equivalent for "toString()", for use with NSLog?
How to: What is the Objective-C equivalent for "toString()", for use with NSLog?
What is the Objective-C equivalent for "toString()", for use with NSLog?
Is there a method that I can override in my custom classes so that when
NSLog(@"%@", myObject)
is called, it will print the fields (or whatever I deem important) of my object? I guess I’m looking for the Objective-C equivalent of Java’s toString().
Answer: What is the Objective-C equivalent for "toString()", for use with…
View On WordPress
Fixed How to print out the method name and line number and conditionally disable NSLog? #dev #it #asnwer
Fixed How to print out the method name and line number and conditionally disable NSLog? #dev #it #asnwer
How to print out the method name and line number and conditionally disable NSLog?
I’m doing a presentation on debugging in Xcode and would like to get more information on using NSLog efficiently.
In particular, I have two questions:
is there a way to easily NSLog the current method’s name / line number?
is there a way to “disable” all NSLogs easily before compiling for release code?
Answer: How…
View On WordPress

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
How to: How to print out the method name and line number and conditionally disable NSLog?
How to: How to print out the method name and line number and conditionally disable NSLog?
How to print out the method name and line number and conditionally disable NSLog?
I’m doing a presentation on debugging in Xcode and would like to get more information on using NSLog efficiently.
In particular, I have two questions:
is there a way to easily NSLog the current method’s name / line number?
is there a way to “disable” all NSLogs easily before compiling for release code?
Answer: How…
View On WordPress
Discovery Of The Day: struct to NSString conversion functions
It is very common when debugging to want to view the various parameters of view frames. But since these are structs, there are no obvious % parameters in an NSLog statement to pass to get to the various components. It gets painful fast:
`NSLog(@"view frame x: %.0f y: %.0f", self.view.frame.origin.x, self.view.frame.origin.y);`
But it turns out that there are a great set of functions to turn these struct parameters into an NSString. I couldn't remember where and this Stack Overflow Post got me headed in the right direction:
NSLog(@"%@", NSStringFromCGRect(self.view.frame));
from the Documentation, the following are available.
NSStringFromCGAffineTransform NSStringFromCGPoint NSStringFromCGRect NSStringFromCGSize NSStringFromUIEdgeInsets NSStringFromUIOffset
Also, do not forget about the ever helpful:
NSLog(@"%s", __PRETTY_FUNCTION__);
This returns the method/function name that it is contained within. Saves lots of typing.
NSLogとかで一意に吐き出せないかな~と思ってたら、 以下の新しいフォーマット指定子を使うことで煩わしさを回避出来るらしい。 ・NSInteger "%zd" ・NSUInteger "%tu" ・16進数 "%tx" > 新しいフォーマット指定子 これは別に新しくはありません。 z と t はそれぞれ size_t 型と ptrdiff_t 型を意味していて、これらの型が NS(U)Integer と同じ大きさの整数型だから転用できているだけです。
Objective-C - 32bitと64bit、共通で使えるNSLogとかのフォーマット指定子 - Qiita http://qiita.com/annaok/items/bf1c80184dac8a9945c2