GUID

Is there anyway to generate a GUID on IOS Xojo?

You should probably read the blow to get an idea of what is and isn’t possible :

iOS Human interface Guidelines

Try this (untested):

[code]Function getGUID() as Text
declare function NSClassFromString lib “Foundation” (clsName as cfstringref) as ptr
dim UIDevicePtr as ptr = NSClassFromString(“UIDevice”)
declare function currentDevice lib “UIKit” selector “currentDevice” (clsRef as ptr) as ptr
dim currentDevicePtr as ptr = currentDevice(UIDevicePtr)

declare function identifierForVendor lib “UIKit” selector “identifierForVendor” (obj_id as ptr) as ptr
dim NSUUIDPtr as ptr = identifierForVendor(currentDevicePtr)

declare function UUIDString lib “Foundation” selector “UUIDString” (obj_id as ptr) as cfstringref
dim GUID as Text = UUIDString(NSUUIDPtr)

return GUID
End Function[/code]

[quote=151826:@Jason King]Function getGUID() as Text
declare function NSClassFromString lib “Foundation” (clsName as cfstringref) as ptr
dim UIDevicePtr as ptr = NSClassFromString(“UIDevice”)
declare function currentDevice lib “UIKit” selector “currentDevice” (clsRef as ptr) as ptr
dim currentDevicePtr as ptr = currentDevice(UIDevicePtr)

declare function identifierForVendor lib “UIKit” selector “identifierForVendor” (obj_id as ptr) as ptr
dim NSUUIDPtr as ptr = identifierForVendor(currentDevicePtr)

declare function UUIDString lib “Foundation” selector “UUIDString” (obj_id as ptr) as cfstringref
dim GUID as Text = UUIDString(NSUUIDPtr)

return GUID
End Function[/quote]

It works great. I just added it to the wrapper project :
https://github.com/Mitchboo/XojoiOSWrapper.git

What about a version for OS X?

found it
https://forum.xojo.com/18029-native-uuid-generation/0#p172843