I have an odd issue on an iPod Touch running iOS 4.2.1 where my app will crash when trying to display a FBProfilePictureView using the Facebook 3.0 SDK.
The way that I display the profile is the same way shown by Facebook in their Personalize tutorial. This is working for my iPhone 4S running 5.1.1 and in the 5.1, 5.0 and 4.3 simulators.
The issue I’m having is I get an EXC_BAD_ACCESS due to a null pointer in FBDataDiskCache‘s init method when it calls:
dispatch_queue_t bgPriQueue =.
dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0);
_fileQueue = dispatch_queue_create(
"File Cache Queue",
DISPATCH_QUEUE_SERIAL);
dispatch_set_target_queue(_fileQueue, bgPriQueue);
bgPrigQueue is null and I believe causing the issue. The FBDataDiskCache code is here. Line 61 is the issue.
This bit of code is called when I try to set the profileId like so: self.userProfileImage.profileID = user.id;
I do think I’m doing anything out of the ordinary and the new SDK supports 4.0. So how do I get around this crash?
So it appears that
DISPATCH_QUEUE_PRIORITY_BACKGROUNDis only available in iOS 5.0 and later.Concurrent Queue with GCD? (iOS 4.2.1)