UIDocumentInteractionController on iOS 8 not work

2014-10-13 Thread Dong Feng
I use class UIDocumentInteractionController for two cases. 1. I want iOS to show the Open-In panel which lists *ALL* apps supporting open-in with a JPEG/PNG files. 2. I want iOS to show the Open-In panel which only has an Instagram icon in it. For the first case, I use the following

Re: How to tell if a file is writable in sandboxed mode?

2013-11-09 Thread Dong Feng
I wonder whether you want to do this in the first place. I had tried the same thing on Windows, that is, checking write permission upfront. I ended up with just writing and letting it fail if the permission was not granted. Windows permission rules are very complicated and API is quite unfriendly.

Text System Document Obsolete and Replacement

2012-06-09 Thread Dong Feng
There once was a document Text System Overview, which seems to have been removed from Cocoa document. Its title still appears in references to class NSTextView, etc, but the link is broken. What's the replacement to this document? I found one Cocoa Text Architecture Guide, is it? Why is there

NSTextView Resize Behavior

2012-06-09 Thread Dong Feng
Hi all, I tried to understand how NSTextView works with NSScrollView, especially when wrapping disabled. My understanding is that NSTextView automatically grow its height (by default) and its width (need some tweak) according to users adding new line and adding new characters. So I did an

Window Identifier on Restoration

2011-12-18 Thread Dong Feng
The document says: When re-creating each window, Cocoa passes the window’s unique identifier string to the restoration class. You are responsible for assigning identifier strings to your windows prior to preserving the window state. Your restoration class can use these identifiers to determine

Re: Window Identifier on Restoration

2011-12-18 Thread Dong Feng
Thank you very much! - Dong 2011/12/18 Fritz Anderson fri...@manoverboard.org On 18 Dec 2011, at 7:42 AM, Dong Feng wrote: But what's the API to assign a unique ID to a window? NSWindow conforms to NSUserInterfaceItemIdentification, whose only method is: @property (copy) NSString

Re: Determine sandbox/entitlements at runtime?

2011-12-15 Thread Dong Feng
For it's a fallback, I think you'd better just try the ScriptingBridge and fallback whenever it fails. It's better than to check the Sandbox presence all beforehand. Does that make sense? Dong 2011/12/15 Eric Wing ewmail...@gmail.com For a Mac app, is there a way to determine if sandboxing

Re: Strange behivor when our document-based Cocoa application launch on lion

2011-12-11 Thread Dong Feng
I think Qiang's problem has nothing to do with the Lion's new asynchronous opening mechanism. Qiang's problem is about whether or not openDocumentWithContentsOfURL... is invoked or not, regardless synch or asynched version. In 10.6, it is not invoked and in Lion it is invoked (and happen to be the

Re: Use Subclass in Interface Builder

2011-10-05 Thread Dong Feng
: message. Your Method 1 corresponds to the a case. Your Method 2 corresponds to the b case. --Andy On Oct 5, 2011, at 1:32 AM, Dong Feng wrote: I have a subclass of NSOpenGLView which named POpenGLView. I tried two ways to use it in IB: Method 1: To create an OpenGL view in IB

Use Subclass in Interface Builder

2011-10-04 Thread Dong Feng
I have a subclass of NSOpenGLView which named POpenGLView. I tried two ways to use it in IB: Method 1: To create an OpenGL view in IB directly, and set its class type POpenGLView. Method 2: To create a NSView in IB, and set its class type POpenGLView. The most significant difference between the

Scrolling Behavior of NSTextView

2010-06-07 Thread Dong Feng
I encountered a wired behavior of NSTextView. I tried to use the following statement to scroll to top: [[_scrollView documentView] scrollPoint:NSMakePoint(0, 0)]; where the *documentView* is a NSTextView. But it seems when the window is in certain size, the scroll-to-top behavior does not take

Re: Scrolling Behavior of NSTextView

2010-06-07 Thread Dong Feng
Thanks for all your replies, Martin and Paul. Martin, I tried the [NSTextView scrollRangeToVisible:] with NSMakeRange(0,0) , but it is the same as to use [scrollPoint:] solely. Only with [glyphRangeForTextContainer:] in prior the scroll-to-top works. I don't think it is the problem of coordinate

Specify Sent Action on Behavior of NSTextField

2010-05-18 Thread Dong Feng
There is a option on IB to specify if an NSTextField Sent Action on Enter Only or Sent Action on Editing. How to set the option programmatically? Thanks, Dong ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or

Re: Safari-4-like Pulldown List

2009-06-17 Thread Dong Feng
Hi Sean, It is a superb answer to my initial question that ease my decision to the next step work. Thank you for the answer and for sharing your project. A great work! Dong. 2009/6/16 Sean Murphy co...@seanmurph.com: On Jun 14, 2009, at 5:01 AM, Dong Feng wrote: I want to implement

Safari-4-like Pulldown List

2009-06-14 Thread Dong Feng
I want to implement a pulldown list like what FireFox does with its address bar (or its Google search bar). I think it involves to open a borderless window and draw items through Cocoa drawing APIs. But when I saw Safari 4, its pulldown list's appearance just like a context-menu, I began thinking

Delayed Framework Loading

2009-06-12 Thread Dong Feng
Is there a way to make a framework not loaded until the first invocation to one of its functions? I know there is a way, that is, to not link the framework to the executable, but use CFURLCreateWithFileSystemPath(). However, this way, you have to resolve all functions you are going to use one by

Re: Delayed Framework Loading

2009-06-12 Thread Dong Feng
I tried to launch without this flag, or with this flag set to 0. Either way, it seems the function with __attribute__((constructor)) is always invoked at launch time, that is, no delay load. 2009/6/13 Kyle Sluder kyle.slu...@gmail.com: dyld (the OS X dynamic linker) already does this.  You

Distinguish Pending Text from Committed Text

2009-05-19 Thread Dong Feng
When using an non-English input method, such as Japanese or Chinese, the entered characters are first in a pending status (i.e. with an underscore). Pressing the space key make those pending text converted to the actual non-English characters. Pressing the Enter key make the underscore beneath the

Re: Distinguish Pending Text from Committed Text

2009-05-19 Thread Dong Feng
? 2009/5/20 Michael Ash michael@gmail.com: On Tue, May 19, 2009 at 9:48 AM, Dong Feng middle.fengd...@gmail.com wrote: When using an non-English input method, such as Japanese or Chinese, the entered characters are first in a pending status (i.e. with an underscore). Pressing the space

Re: SetWindowModality Replacement

2009-01-09 Thread Dong Feng
I think, for the modaless, you need simply invoke [NSWindow makeKeyAndOrderFront:]. On Mac OS X, SystemModal and AppModal are the same and it should work with runModalForWindow. I'm not sure the behavior of kWindowModalityWindowModal. 2009/1/8 Russ matchmo...@yahoo.com: I'm still looking for

Memory Management to NSError

2009-01-06 Thread Dong Feng
How shall we handle the NSError object returned directly or indirectly (through out parameter)? Shall it be released after use? I checked the example code in Apple document but never see a returned NSError object get released. ___ Cocoa-dev mailing

Re: Memory Management to NSError

2009-01-06 Thread Dong Feng
Thank you all for the answers. 2009/1/6 Dong Feng middle.fengd...@gmail.com: How shall we handle the NSError object returned directly or indirectly (through out parameter)? Shall it be released after use? I checked the example code in Apple document but never see a returned NSError object

Display Format Pop-up on Open Panel

2008-12-30 Thread Dong Feng
If there are more than one items, with the same NSDocumentClass, in the CFBundleDocumentTypes array of the Info.plist, I see the Save As... save panel will be automatically augmented with an accessor view containing a format pop-up. Meanwhile, the open panel of Open File... does not have an

Re: Question Regarding the Memory Address of Objects

2008-12-20 Thread Dong Feng
I have a concern that the direct use of a pointer as a memory address may have a problem in the case of GC. In Java, object reference is not a simple memory address because objects may be moved by GC. Does Cocoa has a GC implementation avoid it? 2008/12/19 Carter R. Harrison

Key-bindings Dictionary Location

2008-12-13 Thread Dong Feng
Seems a lot Apple documents say that a key-bindings dictionary should be located either 1) /System/Library/Frameworks/AppKit.framework/Resources/StandardKeyBinding.dict, or 2) ~/Library/KeyBindings/StandardKeyBinding.dict. However, the dictionary used by Xcode has different filename for case 2,