Created
October 31, 2020 02:30
-
-
Save steveriggins/e3b90b4513223649093692694915d752 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// 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