Open Recent Crash
Whenever I do in TextEdit: File → Open Recent I get a crash. Obviously the list of recent documents is somehow corrupted. So I renamed ~/Library/Preferences/com.apple.TextEdit.LSSharedFileList.plist to: LSSharedFileList bad.plist, started TextEdit and got the same crash. Also got a new LSSharedFileList.plist with 20 entries (which seems to be identical to LSSharedFileList bad.plist). So there must be some other location where (corrupted) data about my recent files is kept. But where? Gerriet. 10.10.1; TextEdit Version 1.10 (319). ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Open Recent Crash
Whenever you do something with defaults, ignore the plist file. Instead always use the command line tool defaults. There have been major changes throughout the system releases as to how the defauls daemon works ___m i c h a e l s t a r k e geschäftsführer HicknHack Software GmbH www.hicknhack-software.com ___k o n t a k t +49 (170) 36 86 1 36 cont...@hicknhack.com ___H i c k n H a c k S o f t w a r e G m b H geschäftsführer - maik lathan | andreas reischuck | michael starke bayreuther straße 32 01187 dresden amtsgericht dresden HRB 30351 sitz - dresden On 13.12.2014, at 10:09, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: Whenever I do in TextEdit: File → Open Recent I get a crash. Obviously the list of recent documents is somehow corrupted. So I renamed ~/Library/Preferences/com.apple.TextEdit.LSSharedFileList.plist to: LSSharedFileList bad.plist, started TextEdit and got the same crash. Also got a new LSSharedFileList.plist with 20 entries (which seems to be identical to LSSharedFileList bad.plist). So there must be some other location where (corrupted) data about my recent files is kept. But where? Gerriet. 10.10.1; TextEdit Version 1.10 (319). ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/michael.starke%40hicknhack-software.com This email sent to michael.sta...@hicknhack-software.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Added Toolbar, now main window can't be resized
Everyone, I got my app working pretty much as I desired, then came up with a reason to add a Toolbar. I opened my NIB in IB and dragged one over, added the needed buttons easily, then connected them up so my app responds to them. The only thing is, since adding the Toolbar, my main window has become locked to the designed size. I can’t resize by dragging any edge; the green blob can’t resize the window; and if I zoom to full screen, the drawn part of my app window rests in the upper-left corner and the rest of the display goes black. All my settings for the window in IB are the defaults except that I set Full Screen = Primary Window. The Maximum Size setting is unchecked. What else should I look for to determine why my window became unresizable? — Charles Jenkins ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: wits end with nsview and nsrectfill()
Hi After trying out everything, I finally found how to remove that difference in background color. I couldn’t find any rationale in this patch effect, so I turned the outline selection highlight to none (regular, i.e. plain white also works). So if you take a view-based outline view (or maybe table view as well) and fill a table column’s view’s background with NSRectFill() or any other and add as sub view a transparent text field, upon refresh the text field and the rest of the background will differ in color as long as selection highlight is set to “Source List”. As if source list color superimposes on the area other than the text field. But I still can’t understand the nitty gritty of this. But in this solution, the outline view loses source list style color in its appearance. Also I found that setting the background color does not lead to this patch. Is there anyway I can still get the same source list style color in its appearance and not have this patch? If setting background color is the solution, how to get source list color without applying it? Any ideas? Wishes, Navneet On 04-Dec-2014, at 8:13 pm, Navneet Kumar navnee...@me.com wrote: Hi, The problem is not there if I create a new project and add a text field as subview to a custom view with a background color. There is no difference in color in text field and rest of the area. And also this wasn’t there a couple of months ago, and not using git or subversion, I am not able to locate what I did to get to the current problem. Any ideas what could be happening? Can I get clear on some things?: 1. If a view is send the msg -display, is the msg sent to all its subviews without exception? 2. Could it be that so many views when trying to display (in the main thread of course), could block some views from refreshing altogether? If I could get a few pointers, I might get to the bottom of this problem. Best, Navneet On 01-Dec-2014, at 11:28 am, Navneet Kumar navnee...@me.com wrote: Thanks for the responses. The problem is still there. I don’t need to dynamically add or remove views and was following the wrong way to setup view hierarchy in drawRect:. I have changed it to the following order: initWithFrame: then -(void)setupSubViews in all related classes. So in app delegate I call initWithFrame: and then immediately setupSubViews. The entire view comes to front a lot later. The view hierarchy is complex, starting with a view based outline view, then child of a root node has box views (2 in a row). Every box has this bottom view which has this problem. I’m adding a non-selectable, non-editable text field with setDrawsBackground set to NO, as a subview to this bottom view. In drawRect:, I’m just using NSRectFill() with: NSColor *bgColor = [[NSColor blackColor]blendedColorWithFraction:0.25 ofColor:[NSColor whiteColor]]; [bgColor set]; NSRectFill([self bounds]); And initially the background is same in text field and rest of the area. but on refresh, the rest of the area becomes darker, which shouldn’t be as NSRectFill() is supposed to draw opaquely. Thanks, Navneet On 30-Nov-2014, at 11:24 pm, Kyle Sluder k...@ksluder.com wrote: On Nov 30, 2014, at 9:30 AM, Navneet Kumar navnee...@me.com wrote: Hi, I have a custom view in which I am setting the background using NSRectFill() in drawRect:. You’re aware that this function is only really suitable for drawing opaque colors, yes? If you NSRectFill() with a transparent color, it will not blend that color with the existing backing store. Instead, it will replace all pixels in that rect with transparent ones, obliterating any drawing performed by ancestor views in the hierarchy. I am also adding a text field as subview in this method. This is not allowed. -drawRect: is for drawing, not mutating your view hierarchy. If you want to position/install views at the last possible second before the drawing pass, use -viewWillDraw. But you have not offered any reasons why you need to dynamically add or remove views at all, much less in tandem with the drawing pass. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/navneet_6%40me.com This email sent to navnee...@me.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/navneet_6%40me.com This email sent to navnee...@me.com
WTF is happening?
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/Frameworks/SubtitleKit/SubtitleKitTests/SKSubripParseTest.m:33: error: -[SKSubripParseTest testFileFormatSearch] : failed: caught NSRangeException, *** -[__NSCFString substringFromIndex:]: Index 18 out of bounds; string length 17 ( 0 CoreFoundation 0x7fff926c __exceptionPreprocess + 172 1 libobjc.A.dylib 0x7fff8725976e objc_exception_throw + 43 2 CoreFoundation 0x7fff9266651d +[NSException raise:format:] + 205 3 Foundation 0x7fff8f127b2e -[NSString substringFromIndex:] + 118 4 AppKit 0x7fff8a4e1c49 +[_NSObjectAnimator _targetClass] + 92 5 AppKit 0x7fff8a4e1b79 +[_NSObjectAnimator resolveInstanceMethod:] + 34 6 libobjc.A.dylib 0x7fff8725c954 _ZL28_class_resolveInstanceMethodP10objc_classP13objc_selectorP11objc_object + 80 7 libobjc.A.dylib 0x7fff87262799 lookUpImpOrForward + 356 8 libobjc.A.dylib 0x7fff87262617 lookUpImpOrNil + 20 9 libobjc.A.dylib 0x7fff872545ff class_respondsToSelector + 37 10 SubtitleKit 0x0001000d02c8 +[SKFormat formatEngineForExtension:] + 184 11 SubtitleKitTests0x00010008551e -[SKSubripParseTest testFileFormatSearch] + 142 12 CoreFoundation 0x7fff9253f3cc __invoking___ + 140 13 CoreFoundation 0x7fff9253f222 -[NSInvocation invoke] + 290 14 XCTest 0x000100097919 -[XCTestCase invokeTest] + 253 15 XCTest 0x000100097b1a -[XCTestCase performTest:] + 150 16 XCTest 0x0001000a0700 -[XCTest run] + 257 17 XCTest 0x00010009682b -[XCTestSuite performTest:] + 379 18 XCTest 0x0001000a0700 -[XCTest run] + 257 19 XCTest 0x00010009682b -[XCTestSuite performTest:] + 379 20 XCTest 0x0001000a0700 -[XCTest run] + 257 21 XCTest 0x00010009682b -[XCTestSuite performTest:] + 379 22 XCTest 0x0001000a0700 -[XCTest run] + 257 23 XCTest 0x00010009383c __25-[XCTestDriver _runSuite]_block_invoke + 56 24 XCTest 0x00010009f36d -[XCTestObservationCenter _observeTestExecutionForBlock:] + 162 25 XCTest 0x000100093770 -[XCTestDriver _runSuite] + 269 26 XCTest 0x000100094359 -[XCTestDriver _checkForTestManager] + 678 27 XCTest 0x0001000a35b0 +[XCTestProbe runTests:] + 182 28 xctest 0x00011256 xctest + 4694 29 xctest 0x000115d6 xctest + 5590 30 xctest 0x00010ed3 xctest + 3795 31 libdyld.dylib 0x7fff90e315c9 start + 1 ) smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: wits end with nsview and nsrectfill()
On Dec 13, 2014, at 10:20 AM, Navneet Kumar navnee...@me.com wrote: So if you take a view-based outline view (or maybe table view as well) and fill a table column’s view’s background with NSRectFill() or any other and add as sub view a transparent text field, upon refresh the text field and the rest of the background will differ in color as long as selection highlight is set to “Source List”. As if source list color superimposes on the area other than the text field. I believe the Source List setting means that an NSVisualEffectView lies behind the text field. The only documentation I have been able to find about NSVisualEffectView is (1) in the AppKit release note for Yosemite (which apparently is still only available for Developer Preview 5) and (2) in the NSVisualEffectView reference document. In one of those documents, there is some discussion of what you have to do to avoid unwanted color changes in text fields with NSVisualEffectView in back. -- Bill Cheeseman - b...@cheeseman.name ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WTF is happening?
Why do you think the problem is with “respondsToSelector:”? The error says you’re accessing past the end of a string. On Dec 13, 2014, at 10:20 AM, Maxthon Chan m...@maxchan.info 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/Frameworks/SubtitleKit/SubtitleKitTests/SKSubripParseTest.m:33: error: -[SKSubripParseTest testFileFormatSearch] : failed: caught NSRangeException, *** -[__NSCFString substringFromIndex:]: Index 18 out of bounds; string length 17 ( 0 CoreFoundation 0x7fff926c __exceptionPreprocess + 172 1 libobjc.A.dylib 0x7fff8725976e objc_exception_throw + 43 2 CoreFoundation 0x7fff9266651d +[NSException raise:format:] + 205 3 Foundation 0x7fff8f127b2e -[NSString substringFromIndex:] + 118 4 AppKit 0x7fff8a4e1c49 +[_NSObjectAnimator _targetClass] + 92 5 AppKit 0x7fff8a4e1b79 +[_NSObjectAnimator resolveInstanceMethod:] + 34 6 libobjc.A.dylib 0x7fff8725c954 _ZL28_class_resolveInstanceMethodP10objc_classP13objc_selectorP11objc_object + 80 7 libobjc.A.dylib 0x7fff87262799 lookUpImpOrForward + 356 8 libobjc.A.dylib 0x7fff87262617 lookUpImpOrNil + 20 9 libobjc.A.dylib 0x7fff872545ff class_respondsToSelector + 37 10 SubtitleKit 0x0001000d02c8 +[SKFormat formatEngineForExtension:] + 184 11 SubtitleKitTests0x00010008551e -[SKSubripParseTest testFileFormatSearch] + 142 12 CoreFoundation 0x7fff9253f3cc __invoking___ + 140 13 CoreFoundation 0x7fff9253f222 -[NSInvocation invoke] + 290 14 XCTest 0x000100097919 -[XCTestCase invokeTest] + 253 15 XCTest 0x000100097b1a -[XCTestCase performTest:] + 150 16 XCTest 0x0001000a0700 -[XCTest run] + 257 17 XCTest 0x00010009682b -[XCTestSuite performTest:] + 379 18 XCTest 0x0001000a0700 -[XCTest run] + 257 19 XCTest 0x00010009682b -[XCTestSuite performTest:] + 379 20 XCTest 0x0001000a0700 -[XCTest run] + 257 21 XCTest 0x00010009682b -[XCTestSuite performTest:] + 379 22 XCTest 0x0001000a0700 -[XCTest run] + 257 23 XCTest 0x00010009383c __25-[XCTestDriver _runSuite]_block_invoke + 56 24 XCTest 0x00010009f36d -[XCTestObservationCenter _observeTestExecutionForBlock:] + 162 25 XCTest 0x000100093770 -[XCTestDriver _runSuite] + 269 26 XCTest 0x000100094359 -[XCTestDriver _checkForTestManager] + 678 27 XCTest 0x0001000a35b0 +[XCTestProbe runTests:] + 182 28 xctest 0x00011256 xctest + 4694 29 xctest 0x000115d6 xctest + 5590 30 xctest 0x00010ed3 xctest + 3795 31 libdyld.dylib 0x7fff90e315c9 start + 1 ) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/phillip.mills1%40acm.org This email sent to phillip.mil...@acm.org ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WTF is happening?
On Sat, Dec 13, 2014, at 10:19 AM, Phillip Mills wrote: Why do you think the problem is with “respondsToSelector:”? The error says you’re accessing past the end of a string. Because the crash happens in a call stack that originates in class_respondsToSelector, and involves none of Maxthon's code. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WTF is happening?
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 not support NSObject methods. This calls for runtime equivalent for one of the following NSObject methods: - [NSObject respondsToSelector:(SEL)aSelector] = class_respondsToSelector(Class, SEL) // this crashed. + [NSObject conformsToProtocol:(Protocol *)aProtocol] = class_conformsToProtocol(Class, Protocol *) // check for NSObject protocol, this does not work. + [NSObject isSubclassOfClass:(Class)aClass] // no equivalent, have to implement it myself I ended up creating this: BOOL class_isSubclassOfClass(Class cls, Class other) { for (Class c = cls; c; c = class_getSuperclass(c)) if (c == other) return YES; return NO; } If i remembered it right GNUstep runtime have this function. I will file a bug report to Apple and ask them to add this, as it is useful in class scanning and i am using this technique heavily in jailbreak detection. On Dec 14, 2014, at 01:20, Kyle Sluder k...@ksluder.com wrote: On Sat, Dec 13, 2014, at 10:19 AM, Phillip Mills wrote: Why do you think the problem is with “respondsToSelector:”? The error says you’re accessing past the end of a string. Because the crash happens in a call stack that originates in class_respondsToSelector, and involves none of Maxthon's code. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/max%40maxchan.info This email sent to m...@maxchan.info smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WTF is happening?
If all you care about is if an object is a proxy or not, look at isProxy. -- Gary L. Wade (Sent from my iPad) http://www.garywade.com/ On Dec 13, 2014, at 11:06 AM, Maxthon Chan m...@maxchan.info 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 not support NSObject methods. This calls for runtime equivalent for one of the following NSObject methods: - [NSObject respondsToSelector:(SEL)aSelector] = class_respondsToSelector(Class, SEL) // this crashed. + [NSObject conformsToProtocol:(Protocol *)aProtocol] = class_conformsToProtocol(Class, Protocol *) // check for NSObject protocol, this does not work. + [NSObject isSubclassOfClass:(Class)aClass] // no equivalent, have to implement it myself I ended up creating this: BOOL class_isSubclassOfClass(Class cls, Class other) { for (Class c = cls; c; c = class_getSuperclass(c)) if (c == other) return YES; return NO; } If i remembered it right GNUstep runtime have this function. I will file a bug report to Apple and ask them to add this, as it is useful in class scanning and i am using this technique heavily in jailbreak detection. On Dec 14, 2014, at 01:20, Kyle Sluder k...@ksluder.com wrote: On Sat, Dec 13, 2014, at 10:19 AM, Phillip Mills wrote: Why do you think the problem is with “respondsToSelector:”? The error says you’re accessing past the end of a string. Because the crash happens in a call stack that originates in class_respondsToSelector, and involves none of Maxthon's code. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WTF is happening?
Ain’t work! Will crash if an Object derivative showed up. I am scanning ALL loaded classes and only subclasses of a certain class is interested. But due to the nature of this class scanning before I can make sure that the class derives from NSObject I cannot call any method on it. On Dec 14, 2014, at 03:34, Gary L. Wade garyw...@desisoftsystems.com wrote: If all you care about is if an object is a proxy or not, look at isProxy. -- Gary L. Wade (Sent from my iPad) http://www.garywade.com/ On Dec 13, 2014, at 11:06 AM, Maxthon Chan m...@maxchan.info 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 not support NSObject methods. This calls for runtime equivalent for one of the following NSObject methods: - [NSObject respondsToSelector:(SEL)aSelector] = class_respondsToSelector(Class, SEL) // this crashed. + [NSObject conformsToProtocol:(Protocol *)aProtocol] = class_conformsToProtocol(Class, Protocol *) // check for NSObject protocol, this does not work. + [NSObject isSubclassOfClass:(Class)aClass] // no equivalent, have to implement it myself I ended up creating this: BOOL class_isSubclassOfClass(Class cls, Class other) { for (Class c = cls; c; c = class_getSuperclass(c)) if (c == other) return YES; return NO; } If i remembered it right GNUstep runtime have this function. I will file a bug report to Apple and ask them to add this, as it is useful in class scanning and i am using this technique heavily in jailbreak detection. On Dec 14, 2014, at 01:20, Kyle Sluder k...@ksluder.com wrote: On Sat, Dec 13, 2014, at 10:19 AM, Phillip Mills wrote: Why do you think the problem is with “respondsToSelector:”? The error says you’re accessing past the end of a string. Because the crash happens in a call stack that originates in class_respondsToSelector, and involves none of Maxthon's code. --Kyle Sluder smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WTF is happening?
Are you saying that Apple's well-documented approach to see if an object is derived from NSProxy does not work? If that's the case, you need to submit a bug report to Apple. That's a serious issue that only Apple can help you with. If you are using objects not derived from NSObject nor NSProxy, then change your design. -- Gary L. Wade (Sent from my iPad) http://www.garywade.com/ On Dec 13, 2014, at 11:40 AM, Maxthon Chan m...@maxchan.info wrote: Ain’t work! Will crash if an Object derivative showed up. I am scanning ALL loaded classes and only subclasses of a certain class is interested. But due to the nature of this class scanning before I can make sure that the class derives from NSObject I cannot call any method on it. On Dec 14, 2014, at 03:34, Gary L. Wade garyw...@desisoftsystems.com wrote: If all you care about is if an object is a proxy or not, look at isProxy. -- Gary L. Wade (Sent from my iPad) http://www.garywade.com/ On Dec 13, 2014, at 11:06 AM, Maxthon Chan m...@maxchan.info 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 not support NSObject methods. This calls for runtime equivalent for one of the following NSObject methods: - [NSObject respondsToSelector:(SEL)aSelector] = class_respondsToSelector(Class, SEL) // this crashed. + [NSObject conformsToProtocol:(Protocol *)aProtocol] = class_conformsToProtocol(Class, Protocol *) // check for NSObject protocol, this does not work. + [NSObject isSubclassOfClass:(Class)aClass] // no equivalent, have to implement it myself I ended up creating this: BOOL class_isSubclassOfClass(Class cls, Class other) { for (Class c = cls; c; c = class_getSuperclass(c)) if (c == other) return YES; return NO; } If i remembered it right GNUstep runtime have this function. I will file a bug report to Apple and ask them to add this, as it is useful in class scanning and i am using this technique heavily in jailbreak detection. On Dec 14, 2014, at 01:20, Kyle Sluder k...@ksluder.com wrote: On Sat, Dec 13, 2014, at 10:19 AM, Phillip Mills wrote: Why do you think the problem is with “respondsToSelector:”? The error says you’re accessing past the end of a string. Because the crash happens in a call stack that originates in class_respondsToSelector, and involves none of Maxthon's code. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WTF is happening?
NSProxy checking actually work, but throwing those classes that derive from Object class (note I used capitalised O here, the old Object class from early NeXT times, also used heavily in OS X kernel, GCD and Mach ports) into the mix means that no method can be sent before class is determined. I would suggest Apple add one runtime function class_isSubclassOfClass() that mirrors the functionality of NSObject and NSProxy method isSubclassOfClass so that derivatives of the old Object class can be detected more easily. On Dec 14, 2014, at 03:49, Gary L. Wade garyw...@desisoftsystems.com wrote: Are you saying that Apple's well-documented approach to see if an object is derived from NSProxy does not work? If that's the case, you need to submit a bug report to Apple. That's a serious issue that only Apple can help you with. If you are using objects not derived from NSObject nor NSProxy, then change your design. -- Gary L. Wade (Sent from my iPad) http://www.garywade.com/ On Dec 13, 2014, at 11:40 AM, Maxthon Chan m...@maxchan.info wrote: Ain’t work! Will crash if an Object derivative showed up. I am scanning ALL loaded classes and only subclasses of a certain class is interested. But due to the nature of this class scanning before I can make sure that the class derives from NSObject I cannot call any method on it. On Dec 14, 2014, at 03:34, Gary L. Wade garyw...@desisoftsystems.com wrote: If all you care about is if an object is a proxy or not, look at isProxy. -- Gary L. Wade (Sent from my iPad) http://www.garywade.com/ On Dec 13, 2014, at 11:06 AM, Maxthon Chan m...@maxchan.info 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 not support NSObject methods. This calls for runtime equivalent for one of the following NSObject methods: - [NSObject respondsToSelector:(SEL)aSelector] = class_respondsToSelector(Class, SEL) // this crashed. + [NSObject conformsToProtocol:(Protocol *)aProtocol] = class_conformsToProtocol(Class, Protocol *) // check for NSObject protocol, this does not work. + [NSObject isSubclassOfClass:(Class)aClass] // no equivalent, have to implement it myself I ended up creating this: BOOL class_isSubclassOfClass(Class cls, Class other) { for (Class c = cls; c; c = class_getSuperclass(c)) if (c == other) return YES; return NO; } If i remembered it right GNUstep runtime have this function. I will file a bug report to Apple and ask them to add this, as it is useful in class scanning and i am using this technique heavily in jailbreak detection. On Dec 14, 2014, at 01:20, Kyle Sluder k...@ksluder.com wrote: On Sat, Dec 13, 2014, at 10:19 AM, Phillip Mills wrote: Why do you think the problem is with “respondsToSelector:”? The error says you’re accessing past the end of a string. Because the crash happens in a call stack that originates in class_respondsToSelector, and involves none of Maxthon's code. --Kyle Sluder smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: wits end with nsview and nsrectfill()
On 13 Dec 2014, at 16:45, Bill Cheeseman wjcheese...@gmail.com wrote: On Dec 13, 2014, at 10:20 AM, Navneet Kumar navnee...@me.com wrote: So if you take a view-based outline view (or maybe table view as well) and fill a table column’s view’s background with NSRectFill() or any other and add as sub view a transparent text field, upon refresh the text field and the rest of the background will differ in color as long as selection highlight is set to “Source List”. As if source list color superimposes on the area other than the text field. I believe the Source List setting means that an NSVisualEffectView lies behind the text field. The only documentation I have been able to find about NSVisualEffectView is (1) in the AppKit release note for Yosemite (which apparently is still only available for Developer Preview 5) and (2) in the NSVisualEffectView reference document. In one of those documents, there is some discussion of what you have to do to avoid unwanted color changes in text fields with NSVisualEffectView in back. I think you override -(BOOL) allowsVibrancy to return NO to turn off the NSVisualEffectView’s … err … effect. Cheers, -- Uli Kusterer “The Witnesses of TeachText are everywhere...” http://zathras.de ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: wits end with nsview and nsrectfill()
On Dec 13, 2014, at 3:08 PM, Uli Kusterer witness.of.teacht...@gmx.net wrote: I believe the Source List setting means that an NSVisualEffectView lies behind the text field. The only documentation I have been able to find about NSVisualEffectView is (1) in the AppKit release note for Yosemite (which apparently is still only available for Developer Preview 5) and (2) in the NSVisualEffectView reference document. In one of those documents, there is some discussion of what you have to do to avoid unwanted color changes in text fields with NSVisualEffectView in back. I think you override -(BOOL) allowsVibrancy to return NO to turn off the NSVisualEffectView’s … err … effect. I've found a number of circumstances where that doesn't seem to work, but it's hard to tell just what's going on because the documentation is so skimpy. I am unable to get much that is helpful out of the two WWDC 2014 sessions on advanced Yosemite UI, either. -- Bill Cheeseman - b...@cheeseman.name ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: wits end with nsview and nsrectfill()
On 14 Dec 2014, at 2:20 am, Navneet Kumar navnee...@me.com wrote: So if you take a view-based outline view (or maybe table view as well) and fill a table column’s view’s background with NSRectFill() or any other and add as sub view a transparent text field, upon refresh the text field and the rest of the background will differ in color as long as selection highlight is set to “Source List”. As if source list color superimposes on the area other than the text field. But I still can’t understand the nitty gritty of this. Wait. In your original posting you wrote this: I have a custom view in which I am setting the background using NSRectFill() in drawRect:. I am also adding a text field as subview in this method. The textfield is non-selectable, non-editable and is not set to draw background. So you were talking about an NSTableView or NSOutlineView all along, NOT a custom view? You can't write custom view and really mean table/outline view, then expect a coherent response. The two are not in any way equivalent. Expecially in Yosemite where all sorts of gratutious non-useful effects have been imposed on us to waste processor cycles and give us other pointless headaches. If you are filling the background of a table column using NSRectFill then you should simply stop doing that. The view handles its own background drawing. You are only responsible for setting up the content of the row vews, and if one of those is a custom view (NOT the row view itself, which is assumed to be merely a transparent host for the other views within it), then you can paint the background, allowing for the new flags and features you need to deal with in Yosemite. --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WTF is happening?
The Object class is not used anywhere is OS X. It is deprecated and should have been removed from the runtime long time ago. The OS X kernel does not even include obj runtime, so it can’t possibly use the Object class. Mach port are integer that represent kernel object and not classes. The root class for all OS Object (XPC, GCD, …) is NSObject (which live in the runtime too). If you find subclasses of Object, you are obviously doing something wrong. Le 13 déc. 2014 à 20:57, Maxthon Chan m...@maxchan.info a écrit : NSProxy checking actually work, but throwing those classes that derive from Object class (note I used capitalised O here, the old Object class from early NeXT times, also used heavily in OS X kernel, GCD and Mach ports) into the mix means that no method can be sent before class is determined. I would suggest Apple add one runtime function class_isSubclassOfClass() that mirrors the functionality of NSObject and NSProxy method isSubclassOfClass so that derivatives of the old Object class can be detected more easily. On Dec 14, 2014, at 03:49, Gary L. Wade garyw...@desisoftsystems.com wrote: Are you saying that Apple's well-documented approach to see if an object is derived from NSProxy does not work? If that's the case, you need to submit a bug report to Apple. That's a serious issue that only Apple can help you with. If you are using objects not derived from NSObject nor NSProxy, then change your design. -- Gary L. Wade (Sent from my iPad) http://www.garywade.com/ On Dec 13, 2014, at 11:40 AM, Maxthon Chan m...@maxchan.info wrote: Ain’t work! Will crash if an Object derivative showed up. I am scanning ALL loaded classes and only subclasses of a certain class is interested. But due to the nature of this class scanning before I can make sure that the class derives from NSObject I cannot call any method on it. On Dec 14, 2014, at 03:34, Gary L. Wade garyw...@desisoftsystems.com wrote: If all you care about is if an object is a proxy or not, look at isProxy. -- Gary L. Wade (Sent from my iPad) http://www.garywade.com/ On Dec 13, 2014, at 11:06 AM, Maxthon Chan m...@maxchan.info 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 not support NSObject methods. This calls for runtime equivalent for one of the following NSObject methods: - [NSObject respondsToSelector:(SEL)aSelector] = class_respondsToSelector(Class, SEL) // this crashed. + [NSObject conformsToProtocol:(Protocol *)aProtocol] = class_conformsToProtocol(Class, Protocol *) // check for NSObject protocol, this does not work. + [NSObject isSubclassOfClass:(Class)aClass] // no equivalent, have to implement it myself I ended up creating this: BOOL class_isSubclassOfClass(Class cls, Class other) { for (Class c = cls; c; c = class_getSuperclass(c)) if (c == other) return YES; return NO; } If i remembered it right GNUstep runtime have this function. I will file a bug report to Apple and ask them to add this, as it is useful in class scanning and i am using this technique heavily in jailbreak detection. On Dec 14, 2014, at 01:20, Kyle Sluder k...@ksluder.com wrote: On Sat, Dec 13, 2014, at 10:19 AM, Phillip Mills wrote: Why do you think the problem is with “respondsToSelector:”? The error says you’re accessing past the end of a string. Because the crash happens in a call stack that originates in class_respondsToSelector, and involves none of Maxthon's code. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/mailing%40xenonium.com This email sent to mail...@xenonium.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WTF is happening?
I called objc_copyClassList() to get all loaded classes so that I can scan all loaded classes for decedents of a certain class, and Object is part of this. I am using this as the basis of a plugin mechanism, once the plugin bundle is loaded it should be detected by the app itself, and the app should not retain references to classes of the plugin in long term state to allow seamless plugin unloading. On Dec 14, 2014, at 08:17, Jean-Daniel Dupas mail...@xenonium.com wrote: The Object class is not used anywhere is OS X. It is deprecated and should have been removed from the runtime long time ago. The OS X kernel does not even include obj runtime, so it can’t possibly use the Object class. Mach port are integer that represent kernel object and not classes. The root class for all OS Object (XPC, GCD, …) is NSObject (which live in the runtime too). If you find subclasses of Object, you are obviously doing something wrong. Le 13 déc. 2014 à 20:57, Maxthon Chan m...@maxchan.info mailto:m...@maxchan.info a écrit : NSProxy checking actually work, but throwing those classes that derive from Object class (note I used capitalised O here, the old Object class from early NeXT times, also used heavily in OS X kernel, GCD and Mach ports) into the mix means that no method can be sent before class is determined. I would suggest Apple add one runtime function class_isSubclassOfClass() that mirrors the functionality of NSObject and NSProxy method isSubclassOfClass so that derivatives of the old Object class can be detected more easily. On Dec 14, 2014, at 03:49, Gary L. Wade garyw...@desisoftsystems.com wrote: Are you saying that Apple's well-documented approach to see if an object is derived from NSProxy does not work? If that's the case, you need to submit a bug report to Apple. That's a serious issue that only Apple can help you with. If you are using objects not derived from NSObject nor NSProxy, then change your design. -- Gary L. Wade (Sent from my iPad) http://www.garywade.com/ On Dec 13, 2014, at 11:40 AM, Maxthon Chan m...@maxchan.info wrote: Ain’t work! Will crash if an Object derivative showed up. I am scanning ALL loaded classes and only subclasses of a certain class is interested. But due to the nature of this class scanning before I can make sure that the class derives from NSObject I cannot call any method on it. On Dec 14, 2014, at 03:34, Gary L. Wade garyw...@desisoftsystems.com wrote: If all you care about is if an object is a proxy or not, look at isProxy. -- Gary L. Wade (Sent from my iPad) http://www.garywade.com/ On Dec 13, 2014, at 11:06 AM, Maxthon Chan m...@maxchan.info 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 not support NSObject methods. This calls for runtime equivalent for one of the following NSObject methods: - [NSObject respondsToSelector:(SEL)aSelector] = class_respondsToSelector(Class, SEL) // this crashed. + [NSObject conformsToProtocol:(Protocol *)aProtocol] = class_conformsToProtocol(Class, Protocol *) // check for NSObject protocol, this does not work. + [NSObject isSubclassOfClass:(Class)aClass] // no equivalent, have to implement it myself I ended up creating this: BOOL class_isSubclassOfClass(Class cls, Class other) { for (Class c = cls; c; c = class_getSuperclass(c)) if (c == other) return YES; return NO; } If i remembered it right GNUstep runtime have this function. I will file a bug report to Apple and ask them to add this, as it is useful in class scanning and i am using this technique heavily in jailbreak detection. On Dec 14, 2014, at 01:20, Kyle Sluder k...@ksluder.com wrote: On Sat, Dec 13, 2014, at 10:19 AM, Phillip Mills wrote: Why do you think the problem is with “respondsToSelector:”? The error says you’re accessing past the end of a string. Because the crash happens in a call stack that originates in class_respondsToSelector, and involves none of Maxthon's code. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/mailing%40xenonium.com https://lists.apple.com/mailman/options/cocoa-dev/mailing%40xenonium.com This email sent to mail...@xenonium.com mailto:mail...@xenonium.com smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the