I can’t remember whose library this is but the first time I tried to compile my app in 1015 r3 for the app store I got this error:
Type Mismatch error:Expected Enum Foundation.NSString.NSStringEncoding, but got UInt32
Here’s the code:
declare function availableStringEncodings lib FoundationLib selector "availableStringEncodings" (class_id as Ptr) as Ptr
const sizeOfUInt32 = 4
dim rb_array() as NSStringEncoding
dim m as MemoryBlock = new MemoryBlock(availableStringEncodings(ClassRef))
dim offset as UInt32 = 0
while m.UInt32Value(offset) <> 0
rb_array.append NSStringEncoding(m.UInt32Value(offset)) <----------------This line with rb_array.append NSStringEncoding hilighted.
offset = offset + sizeOfUInt32
wend
return rb_array
@Jason King I have removed the other library and now I need to find replacements for a couple of methods.
The main one I need is the ShowUrl.
ShowURL
ShowURL(url As Text)
// NSString* launchUrl = @"http://www.xojo.com/";
// [[UIApplication sharedApplication] openURL:[NSURL URLWithString: launchUrl]];
Declare Function NSClassFromString Lib "Foundation" (name As CFStringRef) As Ptr
Declare Function sharedApplication Lib "UIKit" Selector "sharedApplication" (obj As Ptr) As Ptr
Dim sharedApp As Ptr = sharedApplication(NSClassFromString("UIApplication"))
// https://developer.apple.com/library/mac/documentation/UIKit/Reference/Foundation/Classes/NSURL_Class/#//apple_ref/occ/clm/NSURL/URLWithString:
Declare Function URLWithString Lib "Foundation" Selector "URLWithString:" ( id As Ptr, URLString As CFStringRef ) As Ptr
Dim nsURL As Ptr = URLWithString(NSClassFromString("NSURL"), url)
// https://developer.apple.com/Library/ios/documentation/UIKit/Reference/UIApplication_Class/index.html#//apple_ref/occ/instm/UIApplication/openURL:
Declare Function openURL Lib "UIKit" Selector "openURL:" (id As Ptr, nsurl As Ptr) As Boolean
Return openURL(sharedApp, nsURL)
ClearFocus
ClearFocus(extends c As iOSControl)
declare sub resignFirstResponder lib "Foundation.Framework" selector "resignFirstResponder" (obj_id as Ptr)
resignFirstResponder(c.handle)
SetFocus
SetFocus(extends c As iOSControl)
declare sub becomeFirstResponder lib "Foundation.Framework" selector "becomeFirstResponder" (obj_id as Ptr)
becomeFirstResponder(c.handle)
The reported errors look like something missing. It is not from iOSWrapper, and am not familiar enough with iOSKit method names to be sure. Could be his code as well.
Just use iOSWrapper which was not the issue…
Or if you prefer, just use the ShowURL method you posted.