Re: Class name as NSString and problem with NSLog?

2014-03-19 Thread Sean McBride
On Thu, 6 Mar 2014 15:47:08 -0800, Greg Parker said: I remember the “Month Of Apple Bugs”** that a hacker group ran in 2007, where they published a new app or OS security vulnerability every day for month. A lot of them were caused by format-string vulnerabilities. Soon thereafter the

Re: Class name as NSString and problem with NSLog?

2014-03-19 Thread Gary L. Wade
You¹ll get more mileage out of that in Radar (they don¹t officially² do Apple-isms), and you might want to add to your bug that the format-recognizer NS_FORMAT_FUNCTION (see NSString.h) should be extended for predicate formats or a new one, NS_PREDICATE_FORMAT_FUNCTION, should be added for such

Class name as NSString and problem with NSLog?

2014-03-06 Thread William Squires
Given an object, and a method within, is there some way to get the name of the class of the object as an NSString? For that matter, what I want to do is something like this: Class MyClass MyClass.h #import Foundation/Foundation.h @interface MyClass : NSObject ... -(void)myMethod; @end

Re: Class name as NSString and problem with NSLog?

2014-03-06 Thread Sixten Otto
First off, you don't need to build the string ahead of time; NSLog() supports vararg formatting: NSLog(@%@ -(void)myMethod, myClassName); Off the top of my head, I can't recall whether Class objects get formatted as the class name automatically: NSLog(@%@ -(void)myMethod, [self class]);

Re: Class name as NSString and problem with NSLog?

2014-03-06 Thread Kyle Sluder
On Mar 6, 2014, at 10:21 AM, William Squires wsqui...@satx.rr.com wrote: Given an object, and a method within, is there some way to get the name of the class of the object as an NSString? For that matter, what I want to do is something like this: Class MyClass MyClass.h #import

Re: Class name as NSString and problem with NSLog?

2014-03-06 Thread Ken Thomases
On Mar 6, 2014, at 12:21 PM, William Squires wrote: Given an object, and a method within, is there some way to get the name of the class of the object as an NSString? Well, you could do NSStringFromClass([self class]) but that gives the name of the object's dynamic class, which is not

Re: Class name as NSString and problem with NSLog?

2014-03-06 Thread Scott Andrew
Even further you can get the current command by using NSStringFromSelector(_cmd); _cmd is the current selector. You can also use NSLog(@“%s”, _PRETTY_FUNCTION”) which will give you the class name and current selector. Do a google search also for NSLog replacements there are ones that do a lot

Re: Class name as NSString and problem with NSLog?

2014-03-06 Thread Lee Ann Rucker
On Mar 6, 2014, at 10:21 AM, William Squires wrote: Also, when I do this (using a literal NSString constant for myClassName above), Xcode marks the line with NSLog with a yellow triangle, and disclosing it says something about passing an NSString instance as being unsecure. Can this

Re: Class name as NSString and problem with NSLog?

2014-03-06 Thread Greg Parker
On Mar 6, 2014, at 10:21 AM, William Squires wsqui...@satx.rr.com wrote: Also, when I do this (using a literal NSString constant for myClassName above), Xcode marks the line with NSLog with a yellow triangle, and disclosing it says something about passing an NSString instance as being

Re: Class name as NSString and problem with NSLog?

2014-03-06 Thread Jens Alfke
On Mar 6, 2014, at 10:21 AM, William Squires wrote: Also, when I do this (using a literal NSString constant for myClassName above), Xcode marks the line with NSLog with a yellow triangle, and disclosing it says something about passing an NSString instance as being unsecure. Can this

Re: Class name as NSString and problem with NSLog?

2014-03-06 Thread Sean McBride
On Thu, 6 Mar 2014 15:15:49 -0800, Jens Alfke said: I remember the “Month Of Apple Bugs”** that a hacker group ran in 2007, where they published a new app or OS security vulnerability every day for month. A lot of them were caused by format-string vulnerabilities. Soon thereafter the compiler

Re: Class name as NSString and problem with NSLog?

2014-03-06 Thread Greg Parker
On Mar 6, 2014, at 3:37 PM, Sean McBride s...@rogue-research.com wrote: On Thu, 6 Mar 2014 15:15:49 -0800, Jens Alfke said: I remember the “Month Of Apple Bugs”** that a hacker group ran in 2007, where they published a new app or OS security vulnerability every day for month. A lot of them