I have an NSArray of my model objects and it is set to (strong,
nonatomic). Just to see if it would make any difference I changed
everything to strong and it didn't make a difference.
I should mention I'm using ARC. Also, if I put a breakpoint in it works
fine. Almost like it gives the model time to save. It's a weird behavior
and I'm exactly sure how to debug it.
On Saturday, May 31, 2014 9:28:58 AM UTC-5, Ragu Vijaykumar wrote:
>
> CBLModel saving is not asynchronous nor thread-safe. What is storing these
> items (CBLModels)? Is the storage mechanism strong or weak? Models can be
> dealloc'd if there are no retained pointers to them.
>
> On Friday, May 30, 2014 1:43:19 PM UTC-7, Nate Smith wrote:
>>
>> I am calling save in my NSOutlineView's -(void)editingDidEnd:(NSNotification
>> *)notification; method and it's causing the next outline view delegate
>> method in the chain to fail because Item is null. Is this because save is
>> doing something behind the scenes that wipes out the memory address of item
>> temporarily?
>>
>> So my edit method looks like this:
>>
>> - (void)editingDidEnd:(NSNotification *)notification {
>> NSTextField *textField = [notification object];
>> SBCategory *item = [_categoryOutlineView itemAtRow:[_categoryOutlineView
>> selectedRow]];
>> NSString* value = [textField stringValue];
>> item.title = value;
>> [item saveCategoryDocument];
>> }
>>
>> saveCategoryDocument looks like this:
>>
>> -(BOOL)saveCategoryDocument {
>> NSError* error;
>>
>> BOOL ok = [self save: &error];
>> if (error) {
>> NSLog(@"Error creating categories document %@", error.
>> localizedDescription);
>> }
>> return ok;
>> }
>>
>>
>> and the next delegate in line looks like this
>>
>> -(BOOL)outlineView:(NSOutlineView *)outlineView isGroupItem:(id)item {
>> return [item isHeader];
>> }
>>
>>
>> In the above method, item is null. If I comment out [item
>> saveCategoryDocument]; in editingDidEnd then every thing works fine ...
>> but it obviously doesn't save the document.
>>
>
--
You received this message because you are subscribed to the Google Groups
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/mobile-couchbase/b42f516a-0a2e-4655-8203-983fb33a7c24%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.