Re: Memory issue with ALAssetLibrary

2014-01-31 Thread Peng Gu
PM, Peng Gu pan...@gmail.com wrote: ​When I use *ALAssetLibrary:assetForURL:resultBlock:failtureBlock *to retrieve full screen images from ​camera roll, the allocated memory never release until the app enters the background. My guess is the system keeps the cache for the images somewhere

Memory issue with ALAssetLibrary

2014-01-30 Thread Peng Gu
​When I use *ALAssetLibrary:assetForURL:resultBlock:failtureBlock *to retrieve full screen images from ​camera roll, the allocated memory never release until the app enters the background. My guess is the system keeps the cache for the images somewhere. Is there anyway to force the system to

Remove alpha channel from uiimage

2014-01-28 Thread Peng Gu
I use the following method to get a decompressed uiimage from file system. However the UIImageView is colored as red when I turn on the color blended layer, even though the UIImageView is set to Opaque. The images on file system don't have alpha channel. I tried set

Re: Remove alpha channel from uiimage

2014-01-28 Thread Peng Gu
Thanks, It works. Seems it uses ARGB instead of RGBA. I used *kCGImageAlphaNoneSkipLast,* which consumes more memory and all the images are colored as copied images. Thank you Peng On Tue, Jan 28, 2014 at 4:10 PM, David Duncan david.dun...@apple.comwrote: On Jan 28, 2014, at 12:37 PM, Peng

UIScrollView Dynamic Paging Size

2013-10-03 Thread Peng Gu
I am implementing a horizontal multi-image scrollview. The images have variable widths, so a portion of the next imageview image also be shown on the screen. To display the next image view correctly, I need to change the paging size. As this link

NSOutlineView doesn't collapse item

2013-06-18 Thread Peng Gu
I have a NSOutlineView, and clicking on a row will expand/collapse the item if it's expandable. if ([self.outlineView isItemExpanded:item]) { NSLog(Will collapse item : %@, item); [[self.outlineView animator] collapseItem:item]; } else { [[self.outlineView

Re: NSOutlineView doesn't collapse item

2013-06-18 Thread Peng Gu
...@mooseyard.com wrote: On Jun 18, 2013, at 7:16 PM, Peng Gu pan...@gmail.com wrote: [[self.outlineView animator] collapseItem:item]; I’ve never tried using the animator proxy to do this; I don’t think it’s necessary (the expand/collapse will be animated anyway.) Have you tried

Move cursor to previous/next line in UITextView

2013-06-07 Thread Peng Gu
In the iPhone/iPad simulator, you can use arrow-up and arrow-down keys on Mac to move the cursor to previous/next line in the UITextView. I'd like to create two buttons that implements the same functionalities. I didn't find any methods that let me do it easily. Any ideas on how to do this?

Re: Move cursor to previous/next line in UITextView

2013-06-07 Thread Peng Gu
I didn't find the key events methods either. Seems Apple doesn't provide it in iOS. Is there any way to calculate the number of characters for lines in UITextView ? On Sat, Jun 8, 2013 at 12:37 AM, Jens Alfke j...@mooseyard.com wrote: On Jun 7, 2013, at 4:26 AM, Peng Gu pan...@gmail.com

iCloud Key-Value Store not Syncing ?

2013-06-01 Thread Peng Gu
* Background:* I am developing a Mac app and an iOS app, and the two apps need to share small piece of data. The Mac app has code-signed by a iCloud enabled development provisioning profile. The value of *com.apple.developer.ubiquity-kvstore-identifier *in the entitlement is set to

Re: iCloud Key-Value Store not Syncing ?

2013-06-01 Thread Peng Gu
Montgomerie ja...@montgomerie.netwrote: On 1 Jun 2013, at 06:16, Peng Gu pan...@gmail.com wrote: * Questions: * 0. Any thoughts on the problems? 1. Is there any way to check if the data is uploaded to the iCloud storage. 2. I'm not a iOS developer membership yet, so the app isn't code-signed

Re: iCloud Key-Value Store not Syncing ?

2013-06-01 Thread Peng Gu
, Peng Gu wrote: Thanks. I just bought the iOS membership, and wait it to be delivered. Do you have any thought why [[*NSFileManager* *defaultManager*] * ubiquityIdentityToken**] *returns nil? I have Mac OS membership, and AppID, entitlements .. seem to be correct. Need any cert

Re: iCloud Key-Value Store not Syncing ?

2013-06-01 Thread Peng Gu
King r...@rols.org wrote: On 2 Jun, 2013, at 8:55 AM, Peng Gu pan...@gmail.com wrote: I've checked a million times. This drove me crazy. Yes well take a deep breath, read the documentation again and start over. Entitlements and provisioning are actually quite simple when you understand them

disable beginSheet animation

2013-05-16 Thread Peng Gu
How do I disable the animation of [NSApp beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo]. Apple document says that Other sheet behavior, such as the animation when it appears and is dismissed, is handled automatically by the Application Kit. Thanks, Peng

Re: disable beginSheet animation

2013-05-16 Thread Peng Gu
: @NSWindowResizeTime]; Thanks, On Fri, May 17, 2013 at 5:50 AM, Peng Gu pan...@gmail.com wrote: How do I disable the animation of [NSApp beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo]. Apple document says that Other sheet behavior, such as the animation when it appears and is dismissed

Re: disable beginSheet animation

2013-05-16 Thread Peng Gu
changing it, so you can restore it exactly afterwards. A question: Why do you want a sheet to pop into view instead of acting as users expect? I am willing to trust you have a good reason, but I'm curious. — F On 16 May 2013, at 5:03 PM, Peng Gu pan...@gmail.com wrote: Found

Validate core data sqlite file

2013-05-12 Thread Peng Gu
Hi I am building an core data app that allows me to backup and restore the data. For backup, I simply copy the sqlite file to selected directory with a name 'app.backup'. For restore, I also simply copy the selected file to the application storage directory with name 'app.sqlite' My question is:

Allow access to Documents folder in a sandbox app

2013-05-08 Thread Peng Gu
Hi, Is there any way to access the documents folder without letting user select it explicitly in a sandbox app? If I want to submit the app to the App Store, does the app have to be sandboxed? Thanks, - Peng ___ Cocoa-dev mailing list

Re: Core data commit changes made programmatically

2013-04-24 Thread Peng Gu
string has changed. --Kyle Sluder On Apr 23, 2013, at 11:41 PM, Peng Gu pan...@gmail.com wrote: I have a textview that is binding to Core data, I want to be able to highlight the selected text in the textview. *[self.textStorage addAttribute:NSBackgroundColorAttributeName value

Core data commit changes made programmatically

2013-04-23 Thread Peng Gu
I have a textview that is binding to Core data, I want to be able to highlight the selected text in the textview. *[self.textStorage addAttribute:NSBackgroundColorAttributeName value:[ NSColor yellowColor] range:self.selectedRange];* The code above works, but core data won't save the attributes

My App crash on 10.7.5, but works on 10.8

2013-04-19 Thread Peng Gu
I have an app, which made it to the App Store just a few days ago. But I received a few crash reports from some users. *The information is as following:* Exception Type: EXC_BAD_INSTRUCTION (SIGILL) Exception Codes: 0x0001, 0x Application Specific Information:

Re: My App crash on 10.7.5, but works on 10.8

2013-04-19 Thread Peng Gu
Found the problem, there's another place I declared the window controller as weak. Thanks. * * * * On Fri, Apr 19, 2013 at 9:19 AM, Uli Kusterer witness.of.teacht...@gmx.netwrote: According to the release notes for ARC:

cursorUpdate was called, but cursor was not updated

2013-04-05 Thread Peng Gu
I have a custom button, which was added as a subview of a textview. And I want the cursor to be changed to arrowCursor instead of the beam cursor when hover on the button. So I added tracking area. The cursorUpdate method was indeed called, but the cursor was still the beam cursor. It seems the

Custom insertion point

2013-03-27 Thread Peng Gu
Hi, I'm changing the insertion point size by overriding *-(void)drawInsertionPointInRect:(NSRect)aRect color:(NSColor *)aColor turnedOn:(BOOL)flag, *But it doesn't handle the first blink (when you move the insertion point, it goes back to normal) I managed to handle the first blink by overriding

custom insertion point

2013-03-26 Thread Peng Gu
Hi, I'm changing the insertion point size by overriding *-(void)drawInsertionPointInRect:(NSRect)aRect color:(NSColor *)aColor turnedOn:(BOOL)flag, *But it doesn't handle the first blink (when you move the insertion point, it goes back to normal) I managed to handle the first blink by overriding

exc bad access when change the contentSize of popover

2013-03-22 Thread Peng Gu
** I have a button to trigger the popover, and a checkbox on the popover. The state checkbox of the checkbox is bound to a field 'checkboxState' of an NSManagedObject. Here is the scenario: 1. I click the button, the popover will show up. 2. I check the checkbox on the popover, then the

Re: exc bad access when change the contentSize of popover

2013-03-22 Thread Peng Gu
What did you mean by the debugger UI? This is my first time to use xcode for development. On Fri, Mar 22, 2013 at 6:43 PM, Jens Alfke j...@mooseyard.com wrote: On Mar 22, 2013, at 1:50 PM, Peng Gu pan...@gmail.com wrote: I worked around the issue by creating new popover when necessary