Re: WTF is happening?

2014-12-15 Thread Britt Durbrow
> In this case you have found that the implementation of +[_NSObjectAnimator > resolveInstanceMethod:] crashes. IMHO, this is a nasty little bug… and a simple test case should be added to the frameworks to check that basic runtime functionality works on all classes - private or publicly decla

Re: WTF is happening?

2014-12-15 Thread Maxthon Chan
I ended up written my own runtime-level equivalent of +[NSObject isSubclassOfClass:] using only class_getSuperclass and object_getClass. This class scanning code, currently used for plugin scanning, will also be used in jailbreak detecting, defeating Cydia Substrate-based iAP crackers. > On Dec

Re: Using AV Foundation to record m3u8 stream to disk

2014-12-15 Thread dangerwillrobinsondanger
I actually just chanced across his book last night while trying to dig through AVAudioEngine. Bought it. Good book so far. Paints a good picture of the overall AV Foundation landscape today. Sent from my iPhone > On 2014/12/16, at 7:59, Kevin Meaney wrote: > > I'm not certain if this is u

Re: Using AV Foundation to record m3u8 stream to disk

2014-12-15 Thread Kevin Meaney
I'm not certain if this is useful to you but Bob McCune on Twitter mentioned a new tech note about new avfoundation apis which specifically mentions reference movies. https://developer.apple.com/library/mac/technotes/tn2404/_index.html#//apple_ref/doc/uid/DTS40015060 I'd also recommend his boo

Re: PList Data Typing

2014-12-15 Thread Ken Thomases
On Dec 15, 2014, at 4:10 PM, Kevin Bracey wrote: > I'm needing to read in a PList, that others have designed, I have no control > over the input. > > One of the Keys stores either a String, Number or Boolean value. > > Checking for the NSString is straight forward. > > How can I tell if the V

Re: PList Data Typing

2014-12-15 Thread Kevin Bracey
Thanks Jens, You’re fantastic! Have a great holiday season to all, and thanks for all the help over the years! On 16/12/2014, at 11:28 am, Jens Alfke wrote: > >> On Dec 15, 2014, at 2:10 PM, Kevin Bracey wrote: >> >> How can I tell if the Value is a Boolean or Number in the NSDictionary? as

Re: PList Data Typing

2014-12-15 Thread Jens Alfke
> On Dec 15, 2014, at 2:10 PM, Kevin Bracey wrote: > > How can I tell if the Value is a Boolean or Number in the NSDictionary? as 0 > and 1 are valid values for a number. There's no clean solution for this. You have to take advantage of the fact that the YES and NO NSNumbers are singleton obj

Re: WTF is happening?

2014-12-15 Thread Wim Lewis
On Dec 13, 2014, at 11:06 AM, Maxthon Chan wrote: > What I am doing here is scanning all loaded classes for subclasses of a > certain class. Before any NSObject method can be issued I have to check if it > is actually NSObject or NSProxy derivative instead of an Object derivative > that does n

PList Data Typing

2014-12-15 Thread Kevin Bracey
Hi All, I'm needing to read in a PList, that others have designed, I have no control over the input. One of the Keys stores either a String, Number or Boolean value. Checking for the NSString is straight forward. How can I tell if the Value is a Boolean or Number in the NSDictionary? as 0 and

Re: WTF is happening?

2014-12-15 Thread Jean-Daniel Dupas
> Le 15 déc. 2014 à 21:36, Greg Parker a écrit : > > >> On Dec 15, 2014, at 11:02 AM, Jean-Daniel Dupas wrote: >> >>> Le 15 déc. 2014 à 19:45, Fritz Anderson a écrit : >>> >>> - As is typical of ObjC plugins, the classes are packaged in a dynamic >>> library; and as is typical, the library

Re: NSRegularExpression segfault

2014-12-15 Thread ecir hana
On Mon, Dec 15, 2014 at 8:04 PM, Jens Alfke wrote: > > > Anyway, please file a bug report with Apple, as this seems to be a bug in > NSRegularExpression. > Done! I'm no expert on regular expressions, but my understanding is that all the > implementations have a couple of pathological conditions

Re: WTF is happening?

2014-12-15 Thread Greg Parker
> On Dec 13, 2014, at 7:20 AM, Maxthon Chan wrote: > > This got me scratching my head, hard. Why would class_respondsToSelector() > crash? (BTW this is used in a class search loop so I cannot use [NSObject > respondsToSelector:] just yet.) Your evil runtime hack is colliding with someone else

Re: WTF is happening?

2014-12-15 Thread Greg Parker
> On Dec 15, 2014, at 11:02 AM, Jean-Daniel Dupas wrote: > >> Le 15 déc. 2014 à 19:45, Fritz Anderson a écrit : >> >> - As is typical of ObjC plugins, the classes are packaged in a dynamic >> library; and as is typical, the library is wrapped in a package directory, >> which your application

Re: NSRegularExpression segfault

2014-12-15 Thread Jens Alfke
> On Dec 15, 2014, at 8:56 AM, ecir hana wrote: > > I don't seem to have "bt" but I got instead from "Problem Report" window: Sounds like you're not running the app in Xcode. If you're hitting a crash or other bug you should always try to reproduce it while running the app in Xcode, so the de

Re: WTF is happening?

2014-12-15 Thread Jean-Daniel Dupas
> Le 15 déc. 2014 à 19:45, Fritz Anderson a écrit : > > I can be dense. Do I understand correctly that > > - You have an application that ideally should run continually. > > - It accepts plugins that provide one or more classes. > > - Those classes must at least observe a protocol; otherwise

Re: WTF is happening?

2014-12-15 Thread Fritz Anderson
I can be dense. Do I understand correctly that - You have an application that ideally should run continually. - It accepts plugins that provide one or more classes. - Those classes must at least observe a protocol; otherwise there would be no sensible way to use them. - They must have unique n

Re: WTF is happening?

2014-12-15 Thread David Duncan
And if you have a constant NSString in the binary, and that string is referenced anywhere in the application, then unloading the binary will crash the next time that constant string is referenced. It is *really* hard to make a properly un-loadable bundle and generally in-advised, as the advanta

Re: WTF is happening?

2014-12-15 Thread Maxthon Chan
My current design is that the main code is never possible of holding strong references to plugin code for extended periods. Main code keeps an eye on a folder and whenever a new bundle is dropped in it is loaded, and whenever a bundle is removed code is unloaded. Class walking is used to detect

Re: WTF is happening?

2014-12-15 Thread David Duncan
> On Dec 15, 2014, at 9:59 AM, Maxthon Chan wrote: > > I do own the entire SubtitleKit framework but the problem is I want it allow > loading and unloading format plugins without restarting the host application. > This library only have one internal parser for basic SubRip format and > plugin

Re: Apple Events not being handled during UI tracking

2014-12-15 Thread David M. Cotter
does anyone have any idea why this is happening now? how to fix it properly? > On Dec 14, 2014, at 12:27 PM, David M. Cotter wrote: > > In Mavericks and earlier, AppleEvents would dispatch as they came in, even > during control-tracking (eg: the menu bar) > however, in Yosemite, AEs are blocke

Re: NSRegularExpression segfault

2014-12-15 Thread ecir hana
On Mon, Dec 15, 2014 at 6:59 PM, ecir hana wrote: > > It's not precisely 11, but yes, I need to have many. > By "many" I mean more than 2 and less than...maybe 10. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin request

Re: NSRegularExpression segfault

2014-12-15 Thread ecir hana
On Mon, Dec 15, 2014 at 6:50 PM, Stephen J. Butler wrote: > > It seems to be related to the number of capture groups you have. For > example, this also succeeds for me: > > > ((?:1+)|(?:2+)|(?:3+)|(?:4+)|(?:5+)|(?:6+)|(?:7+)|(?:8+)|(?:9+)|(?:0+)|(?:a+)) > > Do you really need the 11 capture groups

Re: WTF is happening?

2014-12-15 Thread Maxthon Chan
What I am doing here is to determine a format handling class based on file extension. I want to achieve a drop-to-plugin-folder-and-it-will-work effect and allow one plugin to include multiple format handling classes. Also since I am creating an open system I don’t want to require other plugin w

Re: NSRegularExpression segfault

2014-12-15 Thread Stephen J. Butler
It seems to be related to the number of capture groups you have. For example, this also succeeds for me: ((?:1+)|(?:2+)|(?:3+)|(?:4+)|(?:5+)|(?:6+)|(?:7+)|(?:8+)|(?:9+)|(?:0+)|(?:a+)) Do you really need the 11 capture groups? On Mon, Dec 15, 2014 at 11:20 AM, ecir hana wrote: > > > > On Mon, De

Re: WTF is happening?

2014-12-15 Thread David Duncan
> On Dec 13, 2014, at 7:20 AM, Maxthon Chan wrote: > > This got me scratching my head, hard. Why would class_respondsToSelector() > crash? (BTW this is used in a class search loop so I cannot use [NSObject > respondsToSelector:] just yet.) > > /Users/technix/Developer/Subtitler > Pro/Framewo

Re: NSRegularExpression segfault

2014-12-15 Thread Maxthon Chan
I ran into the same problem trying to write a parser of a markup language. I would suggest you to use some mechanism to break this long input to smaller chunks to match. Reggie is only good for lexical analysis which only deal with smaller chunks, bigger blocks need to be handled using grammatic

Re: NSRegularExpression segfault

2014-12-15 Thread ecir hana
On Mon, Dec 15, 2014 at 6:09 PM, Stephen J. Butler wrote: > > If you read the ICU docs on regular expressions you'll see that it sets an > 8MB limit on head size when evaluating. My guess is that you've run into > this and NSRegularExpression misses a return code somewhere. > I would have thought

Re: NSRegularExpression segfault

2014-12-15 Thread Stephen J. Butler
If you read the ICU docs on regular expressions you'll see that it sets an 8MB limit on head size when evaluating. My guess is that you've run into this and NSRegularExpression misses a return code somewhere. But your pattern is really suboptimal for what you're trying to accomplish. For example,

Re: NSRegularExpression segfault

2014-12-15 Thread ecir hana
On Mon, Dec 15, 2014 at 5:44 PM, Jens Alfke wrote: > > > What's the backtrace? Whenever investigating a crash you should always > start by looking at the stack. (To get this in a text form you can paste > into a message, use the debugger command "bt".) > I don't seem to have "bt" but I got instea

Re: NSRegularExpression segfault

2014-12-15 Thread Jens Alfke
> On Dec 15, 2014, at 8:38 AM, ecir hana wrote: > > Please, can anyone explain to me why does the following program > consistently segfault after 5 characters? I'm running 10.9.5… What's the backtrace? Whenever investigating a crash you should always start by looking at the stack. (To get

NSRegularExpression segfault

2014-12-15 Thread ecir hana
Hi! I recently needed to match some patterns but I encountered a problematic situation. Please, can anyone explain to me why does the following program consistently segfault after 5 characters? I'm running 10.9.5... #import int main () { NSString *pattern = @"(1+)|(2+)|(3+)

Re: WTF is happening?

2014-12-15 Thread Jean-Daniel Dupas
bool isSubclass(Class cls, Class superclass) { if (class_respondsToSelector(object_getClass(cls), @selector(isSubclassOfClass:))) { return [cls isSubclassOfClass:superclass]; } } > Le 15 déc. 2014 à 16:49, Maxthon Chan a écrit : > > But I still need some way to t

Re: WTF is happening?

2014-12-15 Thread Maxthon Chan
But I still need some way to tell them from NSObject/NSProxy decedents from my class walking. Any method calling will cause a crash there. > On Dec 15, 2014, at 23:48, Clark S. Cox III wrote: > > That does not mean that they're using "Object" only that they're using a base > class other than "

Re: WTF is happening?

2014-12-15 Thread Clark S. Cox III
That does not mean that they're using "Object" only that they're using a base class other than "NSObject" or "NSProxy". Why can't you just ignore such classes? Sent from my iPhone > On Dec 14, 2014, at 23:31, Maxthon Chan wrote: > > My class scanning returned several OS* classes that does not

Re: WTF is happening?

2014-12-15 Thread Jean-Daniel Dupas
> Le 15 déc. 2014 à 13:31, Uli Kusterer a écrit : > > On 15 Dec 2014, at 12:42, Jean-Daniel Dupas wrote: >> I found only 5 classes that does not responds to isProxy and they are all >> internal classes, so real code will never have to deal with instances of >> such classes. > > Maxthon is it

Re: WTF is happening?

2014-12-15 Thread Uli Kusterer
On 15 Dec 2014, at 12:42, Jean-Daniel Dupas wrote: > I found only 5 classes that does not responds to isProxy and they are all > internal classes, so real code will never have to deal with instances of such > classes. Maxthon is iterating over the classes in the system. Even internal classes to

Re: WTF is happening?

2014-12-15 Thread Jean-Daniel Dupas
I found only 5 classes that does not responds to isProxy and they are all internal classes, so real code will never have to deal with instances of such classes. And all classes prefixed by « OS_ » inherits NSObject and responds to isProxy. I run the experiment for myself and do not doubt the r

Re: WTF is happening?

2014-12-15 Thread Charles Jenkins
During the course of this thread, Maxthon has given us code that would enable us to run the experiment for ourselves. I do not doubt him. — Charles Jenkins On Monday, December 15, 2014 at 2:31 AM, Maxthon Chan wrote: > My class scanning returned several OS* classes that does not conform to >