Tag Archives: fixed

Recursion in ObjectiveResource with iPhone OS 4.0 [UPDATED]

8 Jun

[UPDATE]
The issue has been fixed in both my own repository and yfactorial‘s repository in a slightly more elegant way than described below. So pull in the latest commit and you’re pretty save :)

git clone http://github.com/stygeo/objectiveresource
cd objectiveresource
git submodule init

[/UPDATE]

If you’re using ObjectiveResource with iPhone OS 4.0 you’ll probably have run in to the recursion problem becausing a EXC_BAD_ACCESS error. I’ve already posted the fix on the Google Groups group, but here it is again.

Somehow ObjectiveResource tries to parse this error and gets stuck in an infinite loop, or at least that’s what I think because you will eventually run out of memory. You can fix this issue rather simple. In ObjectiveResoure locate the file “NSObject+PropertySupport.m” and head over to line 42 (method: + (NSDictionary *)propertyNamesAndTypes). Line 42 should look similar to:

if (![propName isEqualToString:@"_mapkit_hasPanoramaID"]) { ... }

Replace that if statement with the following if statement (this one also fixes a Three20 compatibility isssue):

if (![propName isEqualToString:@"_mapkit_hasPanoramaID"] &&
![propName isEqualToString:@"URLValue"] &&
![propName isEqualToString:@"accessibilityLanguage"] &&
![propName isEqualToString:@"accessibilityFrame"] &&
![propName isEqualToString:@"accessibilityTraits"] &&
![propName isEqualToString:@"accessibilityHint"] &&
![propName isEqualToString:@"accessibilityValue"] &&
![propName isEqualToString:@"accessibilityLabel"] &&
![propName isEqualToString:@"isAccessibilityElement"])

For the sake of being on the save side open file NSObject+ObjectiveResource.m and add the same strings to the excludedPropertyNames list. This should get you all fixed up!

I forked objectiveresource and objectivesupport on github with the fixes.
ObjectiveSupport
ObjectiveResource

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: