Re: Linking to MLMediaSourcePhotosIdentifier

2015-04-23 Thread Roland King
> > > Also, adding the explicit & confuses the compiler - it then marks that code > as dead, stating it will never be executed. I’m not sure how it comes to that > conclusion exactly, > > The reason it comes to that conclusion is because the header file declares that symbol as external but

Re: Linking to MLMediaSourcePhotosIdentifier

2015-04-22 Thread Roland King
> On 23 Apr 2015, at 13:50, Graham Cox wrote: > > >> On 23 Apr 2015, at 3:40 pm, Roland King wrote: >> >> That’s because you didn’t read properly. Check if THE ADDRESS OF THE STRING >> CONSTANT is NULL. >> >> The address of the string constant is &MLMediaSourcePhotosIdentifier > > > I re

Re: Linking to MLMediaSourcePhotosIdentifier

2015-04-22 Thread Graham Cox
> On 23 Apr 2015, at 3:40 pm, Roland King wrote: > > That’s because you didn’t read properly. Check if THE ADDRESS OF THE STRING > CONSTANT is NULL. > > The address of the string constant is &MLMediaSourcePhotosIdentifier I read fine. I may be confused, but my understanding is that extern

Re: Linking to MLMediaSourcePhotosIdentifier

2015-04-22 Thread Roland King
> On 23 Apr 2015, at 13:38, Graham Cox wrote: > > >> On 23 Apr 2015, at 3:30 pm, Roland King wrote: >> >> Check if the address of the string constant is NULL. If it is, it wasn’t >> found. That’s the same as checking for weak linked methods. > > > But that test itself crashes… > > > i.e.

Re: Linking to MLMediaSourcePhotosIdentifier

2015-04-22 Thread Graham Cox
> On 23 Apr 2015, at 3:30 pm, Roland King wrote: > > Check if the address of the string constant is NULL. If it is, it wasn’t > found. That’s the same as checking for weak linked methods. But that test itself crashes… i.e. if I do this: if( MLMediaSourcePhotosIdentifier == nil ) {

Re: Linking to MLMediaSourcePhotosIdentifier

2015-04-22 Thread Graham Cox
More info: I have managed to reproduce the crash on my 10.9 machine, and can confirm that the crash is caused by attempting to access the symbol MLMediaSourcePhotosIdentifier. (It wasn’t crashing because I’d locally defined a string with this name to see if that fixed the probem - it did, but I

Re: Linking to MLMediaSourcePhotosIdentifier

2015-04-22 Thread Roland King
> > What is a clean way to detect whether an externally linked string exists, and > if it does not, to supply it myself? > Check if the address of the string constant is NULL. If it is, it wasn’t found. That’s the same as checking for weak linked methods. ___