quellish

Los Angeles, CA

8h
comment Update Core Data store location to support App Groups
Yes, I saw your several posts on the apple forums. In most cases iCloud ubiquitous content will not work with app groups. There are several past threads at the apple forum that detail why
Feb
22
awarded Necromancer
Feb
21
comment Do Apple Watch Apps require an accompanying iOS app to have a full user interface?
"In this case it seems counterproductive to create an app that replicates behavior and UI of the watchkit for it." This is why it's recommended to implement this as a framework that both share.
Feb
17
comment Core Data How would I use core data to keep the user logged in?
Actually, for this use case (at least as OP describes it) NSURLCredentialStorage is a better choice than to use the Keychain directly. Always prefer the higher level abstraction.
Feb
17
answered How to create standalone instance of Core Data NSManagedObject - not managed
Feb
17
comment How to create standalone instance of Core Data NSManagedObject - not managed
This can result in undefined behavior.
Feb
16
comment Modularize a big iOS app using CocoaPods
@hajder A framework is just a way of packaging a reusable component, and it has long been a practice to build frameworks into applications even if they are not going to be shared with or loaded by other applications. Frameworks have the same uses as libraries as well as a few more because they can contain resources. The "What are Frameworks?" portion of the Frameworks Programming Guide explains this.
Feb
11
comment message sent to deallocated instance error
Please post more of your managed object implementation. Are you overriding an accessor? Are you accessing a primitive value? CoreData uses KVO extensively . It appears that there are unbalanced calls to some of CoreData's internal methods which is very unusual and appears to be the source of the problem
Feb
7
comment How to notify main MOC, changes in background MOC
The Apple sample code is very outdated. Use queue confinement and parent-child contexts. The child context will push changes to the parent.
Jan
30
comment Core Data Transformable Attributes (NSArray) is empty
The reason you see that only in the test is that your test never initializes route or immutableRoute.
Jan
27
revised Core Data Transformable Attributes (NSArray) is empty
added information about faulting
Jan
26
answered Objective-C Subclassing: Do superclass methods have to be declared in the header file to be used in the subclass?
Jan
25
comment How to free memory after using NSJSONSerialization?
@CroiOS, if I am reading your comment correctly you are saying that you are passing NSJSONSerialization 17 MB of NSData? And your application heap is increasing to 30MB, of which 13MB or so is the JSON, and 17 is the NSData?
Jan
25
comment How to free memory after using NSJSONSerialization?
@CroiOS to answer your question you would need to at the very least post an Instruments trace.
Jan
25
comment How to free memory after using NSJSONSerialization?
@HotLicks, the mutable leaves option does not influence wether new strings are allocated or not. It determines wether the value classes used are immutable (i.e. NSString) or mutable (i.e. NSMutableString). The values are allocated in the same way in both cases. The NSData object used by +dataWithContentsOfFile: is created using -initWithBytes:length:copy:freeWhenDone:bytesAreVM: after opening the file with NSReadBytesFromFileWithExtendedAttributes.Both make heavy use of VM and memory mapping. Releasing the NSData instance will not guarantee the buffers will be released immediately.
Jan
25
comment How to free memory after using NSJSONSerialization?
@HotLicks absolutely it is. The values are pointers into the byte buffers. For example, _newJSONValue() finds byte offsets in the buffer that contain string keys (or values) and calls into __newJSONString(), which then creates NSString instances using -initWithBytesNoCopy:length:encoding:freeWhenDone:. At no point is the data that was read from the file copied. And, notably, the argument to freeWhenDone is 0x1. You can see this yourself by looking at the assembly of Foundation or using Instruments.
Jan
25
comment How to free memory after using NSJSONSerialization?
Yes, there is logic. -dataWithContentsOfFile: returns an NSData instance that will load data from the file into a memory mapped buffer on demand. This is not efficient the way you are doing it. +JSONObjectWithData:options:error: is causing that NSData to hit the file over and over and not effectively reuse buffers. The NSDictionary returned from NSJSONSerialization is just a collection of pointers into those buffers. When you nil out the dictionary there is no effect on the pointers. Post your Instruments trace.
Jan
25
comment How to free memory after using NSJSONSerialization?
Yes, and that is expected. You are telling the JSON parser to take jsonData, parse it, and turn it into Foundation objects. This is what JSON parsers do. If you are giving it a lot of data, that is going to take a lot of memory. The memory you use in the heap is not as significant as the dirty VM pages, which you can see in Instruments. How large is the instance of jsonData you are passing?
Jan
25
comment How to free memory after using NSJSONSerialization?
As @HotLicks has pointed out, you should be using the Leaks or Allocations templates of Instruments to diagnose this issue. Otherwise you are only guessing.
Jan
25
comment iOS: View controllers are not releasing when dismissing
What does Instruments tell you?
1 2 3 4 5