Re: Memory issue with ALAssetLibrary

2014-01-31 Thread Peng Gu
Thanks Jens, In my case, it uses at most 12MB memory, new images didn't cause more memory usage. It hasn't caused any problems for my app. Good to know NSCache is released by the OS : ] -- Peng On Fri, Jan 31, 2014 at 10:04 AM, Jens Alfke wrote: > > On Jan 30, 2014, at 1

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 relea

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 wrote: > > On Jan 28, 2014, at 12:37 PM, Peng Gu

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 CGContextSetAlpha(bitmapContext

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

Re: NSOutlineView doesn't collapse item

2013-06-18 Thread Peng Gu
Alfke wrote: > > On Jun 18, 2013, at 7:16 PM, Peng Gu 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 trie

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 ani

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 wrote: > > On Jun 7, 2013, at 4:26 AM, Peng Gu wrote: > &

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? Than

Re: iCloud Key-Value Store not Syncing ?

2013-06-01 Thread Peng Gu
oland King wrote: > > On 2 Jun, 2013, at 8:55 AM, Peng Gu 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

Re: iCloud Key-Value Store not Syncing ?

2013-06-01 Thread Peng Gu
t have the option of enabling iCloud. If I choose development provisioning profile, the xocde gives me error 'The executable was signed with invalid entitlements.' How can I test iCloud without using ad-hoc provisioning ? On Sun, Jun 2, 2013 at 7:47 AM, Alex Zavatone wrote: > >

Re: iCloud Key-Value Store not Syncing ?

2013-06-01 Thread Peng Gu
Montgomerie wrote: > On 1 Jun 2013, at 06:16, Peng Gu 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

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 *64xxQE.co

Re: disable beginSheet animation

2013-05-16 Thread Peng Gu
t the value before > 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, a

Re: disable beginSheet animation

2013-05-16 Thread Peng Gu
0.2 forKey: @"NSWindowResizeTime"]; Thanks, On Fri, May 17, 2013 at 5:50 AM, Peng Gu 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 &

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

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 (Cocoa-dev@lists

Re: Core data commit changes made programmatically

2013-04-24 Thread Peng Gu
to noticing your attributed > string has changed. > > --Kyle Sluder > > On Apr 23, 2013, at 11:41 PM, Peng Gu wrote: > > > I have a textview that is binding to Core data, I want to be able to > > highlight the selected text in the textview. > > > > *[se

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 c

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 wrote: > According to the release notes for ARC: > > > http://developer.apple.com/library/ios/#releasenotes/ObjectiveC/RN-TransitioningToARC/Introdu

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: objc[3

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 cu

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

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 wrote: > > On Mar 22, 2013, at 1:50 PM, Peng Gu wrote: > > > I worked around the issue by creating new popover when necessary, before > chan

exc bad access when change the contentSize of popover

2013-03-21 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 po