I just released a new iPhone app today : http://www.doobox.co.uk/fav/fav.html
My fundamental understanding is that all things equal, code will run in a predictable way every time without deviance.
I have already had a couple of bug reports in saying there experiencing a crash when importing a contact from there phonebook.
All three have stated there running iPhone 5 and iOS 7.0.4 the same as my device.
All three are saying they only see issue with certain contacts.
All three have been great and provided me with a v-card of an offending contact that causes a crash when attempting an import.
None of these v-card contacts cause a crash here for me when i attempt an import.
So apparently all things are not equal.
What could be different about there setup than mine, when they say there device is the same and there operating system is the same as mine..?
They see a crash at the exact point of clicking one of there contact names in there address book, and screen goes white and app closes.
I have attached the handler that would be active at this time, to see if anything stands out. But like a say its fine for me and every one else but these first three people. at a loss
Code: Select all
// ==== STARTS TO CREATE NEW CONTACT FROM PHONEBOOK ==================
command createFavFromExistingContact
mobilePickContact -- // so the phonebook is opening for them fine here
put the result into tContactId -- // could be crashing from here to mating hashes below ########################
if tContactId is not empty then
// check if contact already exists
put the childControlNames of group "main" into tContactGroups
repeat with x=1 to the number of lines of tContactGroups
if the cContactId of group line x of tContactGroups is tContactId then
answer "This contact already exists in your list of fav contacts" with "OK" titled "Stop"
set the cButtonsDisabled of this stack to false
exit createFavFromExistingContact
end if
end repeat
put empty into tPhotoData
put empty into tContactData
put mobileGetContactData (tContactId) into tContactData
// get contact data phone numbers
put "mobile,iphone,main,home,work,other" into tPossNumberTypes
repeat with x = 1 to 6
put item x of tPossNumberTypes into tType
if not(tContactData["phone"][tType][1] is empty) then
put capitilize(tType) & space & ":" & space & tContactData["phone"][tType][1] into tPhoneNumbers[x]
end if
end repeat
// get contact data names
put tContactData["firstname"] into tFirstName
put tContactData["lastname"] into tLastName
if not(tFirstName is empty) then
put capitilize(tFirstName) into tFirstName
put tFirstName into tContactFullName
end if
if not(tLastName is empty) then
put capitilize(tLastName) into tLastName
if not(tFirstName is empty) then
put space & tLastName after tContactFullName
else
put tLastName into tContactFullName
end if
end if
if the number of chars of tContactFullName > 16 then
put char 1 to 15 of tContactFullName & ".." into tContactFullName
end if
if tContactFullName is empty then
put "No Name" into tContactFullName
end if
// get contact data email addresses
put "home,work,other" into tPossEmailTypes
repeat with x = 1 to 3
put item x of tPossEmailTypes into tType
if not(tContactData["email"][tType][1] is empty) then
put capitilize(tType) & space & ":" & space & tContactData["email"][tType][1] into tEmailAddresses[x]
end if
end repeat
// see if a photo exists
try
put mergContactImage(tContactId,"original") into tPhotoData
catch e
answer "Sorry something unexpected happened" & cr & e with "OK" Titled "Fatal Error"
set the cButtonsDisabled of this stack to false
exit createFavFromExistingContact
end try
// if no photo we can add one or skip
if tPhotoData is empty then
put mergPopSheet("No photo was found with this contact","Skip","","Take Photo,Choose Photo","default") into it
put it into tResult
if tResult is "Choose Photo" then
put pickNewPhoto("library") into tPhotoData
else if tResult is "Take Photo" then
put pickNewPhoto("camera") into tPhotoData
end if
end if -- // not starting to render so doubt its passing here ########################
renderNewContactGroup tContactId, tFirstName, tLastName, tContactFullName, tPhoneNumbers, tPhotoData, tEmailAddresses
else
if mainGroupIsEmpty() then
showAddFirstGroup
end if
set the cButtonsDisabled of this stack to false
end if
end createFavFromExistingContact