If I could add one more tedious detail: I found some third party sample timer 
code that is the same as mine so far as dispatch_source_create is concerned, 
but the source is created from within an objective-c class. Now, 
dispatch_source_create is of course a C method. But could it be that it needs 
to be called from inside an objective-C class when compiling for ios >= 6? 
Can't figure why that would be necessary, but who am I to say - I'm using it 
inside a C++ object.

Thanks, Jeff

Right - it does compile fine, but crashes if built for 6.0 or greater. Works 
with no problem if compiled for 5.1. But that gives customers the impression 
the app is compatible with 5.1, which it is not.

The app is using ARC, so I never release. The crash comes at 
dispatch_source_create().

The Docs for dispatch_source_create say that the first argument is of type 
dispatch_source_type_t and must be one of the listed constants, such as the one 
I'm using, DISPATCH_SOURCE_TYPE_TIMER.

The docs say that arguments 2 and 3 in dispatch_source_create are unused if the 
type is DISPATCH_SOURCE_TYPE_TIMER, so they should be null, and are.

That leaves the third argument, the queue, which appears to be correctly 
created using dispatch_queue_create(threadname,DISPATCH_QUEUE_SERIAL). 

Again, the whole thing works great if compiled for 5.1.  This code seems to be 
in full accordance with the available docs, and there is no sample code listed 
in the docs, so I'm stumped.

Thanks, Jeff


On Feb 6, 2015, at 11:10 AM, David Duncan wrote:



I think the only real change is that under ARC you shouldn’t use 
dispatch_release(), but this is generic to dispatch objects everywhere. But I 
was also under the impression that in that configuration your application 
wouldn’t compile, but that could have been an incorrect impression. See the 
dispatch_release() docs for more information.

> On Feb 6, 2015, at 11:00 AM, Jeff Evans <[email protected]> wrote:
> 
> David and others  -- 
> 
>       Is there any sample code somewhere that would should how to use 
> create_dispatch_queue in apps built for ios 6 and greater?
> 
>       I've been fooling around with this but cannot find anything that works 
> except for this, which is for ios 5.1 and earlier:
>       
>       m_dispatch_source = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 
> 0, 0, m_dispatch_queue);
> 
>       Judging from David's remark below about dispatch types becoming Obj-C 
> objects at ios 6.0, it is probably the first argument that is causing this to 
> crash if the app is built for ios >= 6.0. But in all the sample code I find, 
> there is no mention of using anything other than DISPATCH_SOURCE_TYPE_TIMER 
> as the first argument.  
> 
>       Thanks, Jeff
> 
> 
> 
> On Feb 3, 2015, at 10:57 AM, Jeff Evans wrote:
> 
> Sorry, I should have supplied that - it crashes inside create_dispatch_queue 
> at -[OS_dispatch_source_xref_dispose] with "Thread 1: EXC_ARM_BREAKPOINT, 
> subcode=0xdefe"
> 
> 
> On Feb 3, 2015, at 10:48 AM, David Duncan wrote:
> 
> 
> 
> 
>> On Feb 3, 2015, at 10:34 AM, Jeff Evans <[email protected]> wrote:
>> 
>> All,
>> 
>>      I've been using an ios deployment target setting of 5.1, much against 
>> my will, because dispatch_source_create reliably crashes if I set the 
>> deployment target to 6.0 or higher. This gives people the impression that 
>> the app is compatible with ios 5.1, which it is not.
> 
> How is your app crashing?
> 
> IIRC, 6.0 was when dispatch types became Obj-C objects. I’m not certain what 
> issues that may cause, but I don’t expect them to be insurmountable.
> 
>> 
>>      The data type of the return value is dispatch_source_t.  Someone has 
>> mentioned that create_dispatch_source returns an OS_dispatch_source instead 
>> of dispatch_source_t if deploying to ios >= 6.0. But OS_dispatch_source 
>> doesn't seem to be defined and I don't see how it can be used by 
>> dispatch_source_create.
>> 
>>      I've seen another mention of someone encountering this problem, but no 
>> one has responded to either. Are so few people using dispatch_source_create 
>> with deployments > ios 5.1? I have a feeling I'm making some dumb mistake 
>> here. 
>> 
>>      Thanks, Jeff
>> 
>> 
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Xcode-users mailing list      ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/xcode-users/david.duncan%40apple.com
>> 
>> This email sent to [email protected]
> 
> --
> David Duncan
> 
> 
> 
> 

--
David Duncan




--
If this email is spam, report it to
https://support.onlymyemail.com/view/report_spam/MTAxOTYyOjE3Mzc3Nzc1ODg6amV2YW5zQGFycy1ub3ZhLmNvbTpkZWxpdmVyZWQ


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/xcode-users/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to