Skip to content

Instantly share code, notes, and snippets.

@steveriggins
Created October 31, 2020 02:30
Show Gist options
  • Save steveriggins/e3b90b4513223649093692694915d752 to your computer and use it in GitHub Desktop.
Save steveriggins/e3b90b4513223649093692694915d752 to your computer and use it in GitHub Desktop.
/// PrintIt.swift
@objcMembers public class PrintIt: NSObject {
func printIt(_ dict: [String : String]) {
print(dict)
}
}
/// ViewController.m
#import <PrintIt-Swift.h>
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
NSMutableDictionary *nonStrings = [NSMutableDictionary new];
[nonStrings setObject:@100 forKey:@"Steve"];
PrintIt *p = [PrintIt new];
[p printIt:nonStrings];
}
/// Result
SIGABRT
Could not cast value of type '__NSCFNumber' (0x7fff86d3d610) to 'NSString' (0x7fff86d63d00).
2020-10-30 18:52:44.553678-0700 PrintIt[31294:380864] Could not cast value of type '__NSCFNumber' (0x7fff86d3d610) to 'NSString' (0x7fff86d63d00)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment