objective c - I'm getting an Incompatible pointer types warning -
i'm trying create extension air application , have been following documentation on adobe's website , other examples , looks correct don't know enough objective c know why i'm getting warning.
#import "flashruntimeextensions.h" @import contacts; @import uikit; cnauthorizationstatus contactstatus; cncontactstore * contactstore; cncontactfetchrequest * request; nsmutablearray * contacts; nsarray * fullcontactlist; freobject hascontactlistaccess(frecontext ctx, void* funcdata, uint32_t argc) { uint32_t statusresult = true; if(contactstatus == cnauthorizationstatusdenied){ statusresult = false; } freobject returnboolean = nil; frenewobjectfrombool(statusresult,&returnboolean); return returnboolean; } freobject getallcontacts(frecontext ctx, void* funcdata, uint32_t argc){ contactstore = [[cncontactstore alloc] init]; [contactstore requestaccessforentitytype:cnentitytypecontacts completionhandler:^(bool granted, nserror * _nullable error) { contacts = [nsmutablearray array]; nserror * fetcherror; request = [[cncontactfetchrequest alloc] initwithkeystofetch:@[cncontactidentifierkey, [cncontactformatter descriptorforrequiredkeysforstyle:cncontactformatterstylefullname]]]; bool success = [contactstore enumeratecontactswithfetchrequest:request error:&fetcherror usingblock:^(cncontact * _nonnull contact, bool * stop) { [contacts addobject:contact]; }]; if(!success) { nslog(@"error = %@", fetcherror); } fullcontactlist = [contacts copy]; }]; freobject contactsobject = null; frenewobject((const uint8_t*)"array", 0, null, &contactsobject, nil); return contactsobject; } void aircontextinitializer(void* extdata, const uint8_t* ctxtype, frecontext ctx, uint32_t* numfunctionstoset, const frenamedfunction** functionstoset){ contactstore = [[cncontactstore alloc] init]; *numfunctionstoset = 2; frenamedfunction* func = (frenamedfunction*)malloc(sizeof(frenamedfunction) * *numfunctionstoset); func[0].name = (const uint8_t*)"hascontactlistaccess"; func[0].functiondata = null; func[0].function = &hascontactlistaccess; func[1].name = (const uint8_t*)"getallcontacts"; func[1].functiondata = null; func[1].function = &getallcontacts; *functionstoset = func; } void aircontextfinalizer(frecontext ctx) { return; } void airextensioninitializer(void** extdatatoset, frecontextinitializer* ctxinitializertoset, frecontextfinalizer* ctxfinalizertoset) { *extdatatoset = null; *ctxinitializertoset = &aircontextinitializer; }
the warnings showing on lines 59 , 63:
func[0].function = &hascontactlistaccess; func[1].function = &getallcontacts;
Comments
Post a Comment