0
我与价值的NSUInteger的分配连接的问题:数不兼容类型(“NSUInteger”(又名“无符号长”)和“ID _Nullable”)
self.selectedGroup = GroupType //It is 3 from enum
self.menuItemsPostion = @{[NSNumber numberWithInteger:GroupType]: @0, [NSNumber numberWithInteger:GroupTime]: @1};
NSUInteger itemToSelect = [self isCapturedEntriesContainClienst] ? 1 : self.menuItemsPostion[[NSNumber numberWithInteger:self.selectedGroup]]; // Incompatible operand types ('NSUInteger' (aka 'unsigned long') and 'id _Nullable')
我理解来自NSDictionary
该方法。
- (nullable id)objectForKey:(id)key;
可以返回可为空的对象,这就是为什么是一个问题。
我很感兴趣如何才能解决这个问题。
THX我完全忘了这个 –
'@(selectedGroup)'更简洁... – Droppy
是的,它是更好:) –