簡體   English   中英

我無法獲取ShortcutItem。 userInfo的值

[英]I can't get shortcutItem. The value of the userInfo

3DTouch

這個清單

<dict>
        <key>UIApplicationShortcutItemIconType</key>
        <string>UIApplicationShortcutIconTypeShare</string>
        <key>UIApplicationShortcutItemTitle</key>
        <string>share</string>
        <key>UIApplicationShortcutItemType</key>
        <string>UITouchText.share</string>
        <key>UIApplicationShortcutItemUserInfo</key>
        <dict/>
        <key>url</key>
        <string>value1</string>
    </dict>

和在

-(void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL))completionHandler

我想獲取shortcutItem.userInfo

if([shortcutItem.type isEqualToString:@"UITouchText.share"])
{
      NSLog(@"%@",shortcutItem.userInfo[@"url"]);  
}

但是字典返回空

抱歉,此列表是錯誤的。

<dict>
        <key>UIApplicationShortcutItemIconType</key>
        <string>UIApplicationShortcutIconTypeShare</string>
        <key>UIApplicationShortcutItemTitle</key>
        <string>share</string>
        <key>UIApplicationShortcutItemType</key>
        <string>UITouchText.share</string>
        <key>UIApplicationShortcutItemUserInfo</key>
        <dict>
            <key>url</key>
            <string>value1</string>
        </dict>
    </dict>

作為屬性列表打開

這是錯的 這是錯的 這是真的 這是真的

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM