Re: exception when I try to access a managedObject property from within an accessor of another property

2011-02-21 Thread Sean McBride
On Mon, 21 Feb 2011 16:53:10 -0600, Brad Stone said:

>When I replace:
>if ([[self valueForKey:@"isEncrypted"] boolValue])
>
>with
>if (1 == 2 ) or if (1 == 1 )

What if you do:

id foo = [self valueForKey:@"isEncrypted"];

then

po foo

in gdb

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


exception when I try to access a managedObject property from within an accessor of another property

2011-02-21 Thread Brad Stone
I am getting an exception when I try to access a managedObject property from 
within an accessor of another property.  As ridiculous as it sounds I've been 
at this for over three days.  Hopefully someone can point out what I'm doing 
wrong.


- (NSString *)category 
{
NSString * tmpValue;

[self willAccessValueForKey:@"category"];
tmpValue = [self primitiveCategory];
[self didAccessValueForKey:@"category"];


if ([[self valueForKey:@"isEncrypted"] boolValue]) {  // THIS IS CAUSING 
THE PROBLEM
NSData *sData = [tmpValue dataUsingEncoding:NSUTF8StringEncoding];
sData = [sData decryptWithString:@"userKey"];
tmpValue = [SRGlobalVariables getStringFromData:sData];
}
 
 
return tmpValue;
}

The error I get is:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x7fff5f3ffd80
0x7fff843748d7 in _CFArrayReplaceValues ()
The program being debugged was signaled while in a function called from GDB.
GDB has restored the context to what it was before the call.
To change this behavior use "set unwindonsignal off"
Evaluation of the expression containing the function (_NSPrintForDebugger) will 
be abandoned.


When I replace:
if ([[self valueForKey:@"isEncrypted"] boolValue]) 

with 
if (1 == 2 ) or if (1 == 1 ) 


I don't get an exception. ___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com