• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java NSDictionary类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.robovm.apple.foundation.NSDictionary的典型用法代码示例。如果您正苦于以下问题:Java NSDictionary类的具体用法?Java NSDictionary怎么用?Java NSDictionary使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NSDictionary类属于org.robovm.apple.foundation包,在下文中一共展示了NSDictionary类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: didFinishLaunching

import org.robovm.apple.foundation.NSDictionary; //导入依赖的package包/类
@Override
public boolean didFinishLaunching(UIApplication application,
		NSDictionary<NSString, ?> launchOptions) {
	
	window = new UIWindow(UIScreen.getMainScreen().getBounds());

	GenderListTableViewController genderListTableViewController = new GenderListTableViewController();
	UINavigationController navigationController = new UINavigationController(genderListTableViewController);
	navigationController.addStrongRef(genderListTableViewController);
	navigationController.setDelegate(new UINavigationControllerDelegateAdapter() {});
	window.setRootViewController(navigationController);
	window.setBackgroundColor(UIColor.colorWhite());
	window.makeKeyAndVisible();

	return true;
}
 
开发者ID:Kourtessia,项目名称:RoboVM-for-iOS,代码行数:17,代码来源:RoboVMTableViewApplicationDelegate.java


示例2: viewWillAppear

import org.robovm.apple.foundation.NSDictionary; //导入依赖的package包/类
@Override
public void viewWillAppear(boolean animated) {
    super.viewWillAppear(animated);

    FacebookHandler.getInstance().requestFriends(new FacebookHandler.RequestListener() {
        @SuppressWarnings("unchecked")
        @Override
        public void onSuccess(NSObject result) {
            FacebookHandler.log("Friends result: %s", result);

            NSDictionary<NSString, ?> root = (NSDictionary<NSString, ?>) result;
            friends = (NSArray<NSDictionary<NSString, ?>>) root
                    .get(new NSString("data"));
            getTableView().reloadData();
        }

        @Override
        public void onError(String message) {
            FacebookHandler.getInstance().alertError("Error while getting a list of your friends!", message);
        }

        @Override
        public void onCancel() {}
    });
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:26,代码来源:FriendsViewController.java


示例3: didReceiveDeepLink

import org.robovm.apple.foundation.NSDictionary; //导入依赖的package包/类
@Override
public void didReceiveDeepLink(GPPDeepLink deepLink) {
    String deepLinkID = deepLink.getDeepLinkID();
    NSData decodedData = GTLBase64.decodeWebSafe(deepLinkID);
    if (decodedData == null)
        return;

    try {
        deepLinkParams = (NSDictionary<?, ?>) NSJSONSerialization.createJSONObject(decodedData,
                NSJSONReadingOptions.None);
        Log.d("Deep link ID is %s", deepLinkID);
        Log.d("This is my dictionary %s", deepLinkParams);
    } catch (NSErrorException e) {
        e.printStackTrace();
    }

    if (challengeReceivedHandler != null) {
        challengeReceivedHandler.run();
    }
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:21,代码来源:TypeNumberApp.java


示例4: logEventWithParametersAction

import org.robovm.apple.foundation.NSDictionary; //导入依赖的package包/类
private void logEventWithParametersAction() {
    UIAlertView alert = new UIAlertView("Log Event with Parameters", "Select parameters:",
            new UIAlertViewDelegateAdapter() {
                @Override
                public void clicked(UIAlertView alertView, long buttonIndex) {
                    final String eventName = "Event_with_Parameters";
                    switch ((int) buttonIndex) {
                    case 1:
                        Map<String, String> params1 = new HashMap<>();
                        params1.put("Param1", String.valueOf(101));
                        Flurry.logEvent(eventName, params1);
                        break;
                    case 2:
                        NSDictionary<?, ?> params2 = new NSMutableDictionary<>();
                        params2.put("Param1", "Test");
                        params2.put("Param2", 202);
                        Flurry.logEvent(eventName, params2);
                        break;
                    default:
                        break;
                    }
                }
            }, "Cancel", "Param1 = 101", "Param1 = Test, Param2 = 202");
    alert.show();
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:26,代码来源:MainMenuViewController.java


示例5: scheduleLocalNotification

import org.robovm.apple.foundation.NSDictionary; //导入依赖的package包/类
/**
 * Schedule a local notification.
 * 
 * @param id
 * @param title
 * @param message
 * @param action
 * @param fireDate
 */
public void scheduleLocalNotification(String id, String category, String title, String message, String action,
        Date fireDate) {
    UILocalNotification notification = new UILocalNotification();
    NSDictionary<?, ?> userInfo = new NSMutableDictionary<>();
    userInfo.put(LOCAL_NOTIFICATION_ID_KEY, id);
    notification.setUserInfo(userInfo);
    notification.setAlertTitle(title);
    notification.setAlertBody(message);
    notification.setAlertAction(action);
    notification.setFireDate(new NSDate(fireDate));

    if (category != null) {
        // This will make the notification actionable.
        notification.setCategory(category);
    }

    UIApplication.getSharedApplication().scheduleLocalNotification(notification);
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:28,代码来源:AppDelegate.java


示例6: prepareForSegue

import org.robovm.apple.foundation.NSDictionary; //导入依赖的package包/类
@Override
public void prepareForSegue(UIStoryboardSegue segue, NSObject sender) {
    if (shortcutItem == null) {
        throw new RuntimeException("shortcutItem was not set");
    }

    if (segue.getIdentifier().equals("ShortcutDetailUpdated")) {
        // In the updated case, create a shortcut item to represent the
        // final state of the view controller.
        UIApplicationShortcutIconType iconType = getIconTypeForSelectedRow((int) pickerView.getSelectedRow(0));

        UIApplicationShortcutIcon icon = new UIApplicationShortcutIcon(iconType);

        NSDictionary<NSString, ?> info = new NSMutableDictionary<>();
        info.put(ApplicationShortcuts.APPLICATION_SHORTCUT_USER_INFO_ICON_KEY, pickerView.getSelectedRow(0));
        shortcutItem = new UIApplicationShortcutItem(shortcutItem.getType(), titleTextField.getText(),
                subtitleTextField.getText(), icon, info);
    }
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:20,代码来源:ShortcutDetailViewController.java


示例7: populateRegistrationDomain

import org.robovm.apple.foundation.NSDictionary; //导入依赖的package包/类
/**
 * Locates the file representing the root page of the settings for this app,
 * invokes loadDefaults:fromSettingsPage:inSettingsBundleAtURL: on it, and
 * registers the loaded values as the app's defaults.
 */
private void populateRegistrationDomain() {
    NSURL settingsBundleURL = NSBundle.getMainBundle().findResourceURL("Settings", "bundle");

    /*
     * Invoke loadDefaults() on the property list file for the root settings
     * page (always named Root.plist).
     */
    NSDictionary<NSString, ?> appDefaults = loadDefaults("Root.plist", settingsBundleURL);

    /*
     * appDefaults is now populated with the preferences and their default
     * values. Add these to the registration domain.
     */
    NSUserDefaults.getStandardUserDefaults().registerDefaults(appDefaults);
    NSUserDefaults.getStandardUserDefaults().synchronize();
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:22,代码来源:AppPrefs.java


示例8: didFinishLaunching

import org.robovm.apple.foundation.NSDictionary; //导入依赖的package包/类
@Override
public boolean didFinishLaunching(UIApplication application,
		UIApplicationLaunchOptions launchOptions) {

	MobClick.startWithAppkey("549fbc52fd98c5ca3600092b",
			ReportPolicy.BATCH, "ios");

	MobClickGameAnalytics.pay(100, 1, 200);
	MobClickGameAnalytics.buy("xxoo", 1, 100);
	MobClickGameAnalytics.use("xxoo", 1, 100);

	MobClickGameAnalytics.startLevel("1");
	MobClickGameAnalytics.finishLevel("1");
	MobClickGameAnalytics.failLevel("1");

	final NSDictionary<NSString, NSString> dic = new NSDictionary<NSString, NSString>();
	dic.setAssociatedObject(new NSString("1"), new NSString("1"));
	dic.setAssociatedObject(new NSString("2"), new NSString("2"));

	MobClickSocialWeibo weibo = new MobClickSocialWeibo(MobClickSocialWeibo.MobClickSocialTypeSina(),
			"xxxxxxxooooo", "12345", dic);
	List<MobClickSocialWeibo> weibos = new ArrayList<MobClickSocialWeibo>();
	weibos.add(weibo);

	MobClickSocialAnalytics.postWeiboCounts(weibos,
			"549fbc52fd98c5ca3600092b", "测试", null);

	return super.didFinishLaunching(application, launchOptions);
}
 
开发者ID:tianqiujie,项目名称:robovm-ios-bindings,代码行数:30,代码来源:IOSLauncher.java


示例9: didFinishLaunching

import org.robovm.apple.foundation.NSDictionary; //导入依赖的package包/类
@Override
public boolean didFinishLaunching(UIApplication application,
		UIApplicationLaunchOptions launchOptions) {

	MobClick.startWithAppkey("your key", ReportPolicy.BATCH, "ios");

	MobClickGameAnalytics.pay(100, 1, 200);
	MobClickGameAnalytics.buy("xxoo", 1, 100);
	MobClickGameAnalytics.use("xxoo", 1, 100);

	MobClickGameAnalytics.startLevel("1");
	MobClickGameAnalytics.finishLevel("1");
	MobClickGameAnalytics.failLevel("1");

	final NSDictionary<NSString, NSString> dic = new NSDictionary<NSString, NSString>();
	dic.setAssociatedObject(new NSString("1"), new NSString("1"));
	dic.setAssociatedObject(new NSString("2"), new NSString("2"));

	MobClickSocialWeibo weibo = new MobClickSocialWeibo(
			MobClickSocialWeibo.MobClickSocialTypeSina(), "xxxxxxxooooo",
			"12345", dic);
	List<MobClickSocialWeibo> weibos = new ArrayList<MobClickSocialWeibo>();
	weibos.add(weibo);

	MobClickSocialAnalytics.postWeiboCounts(weibos, "your key", "测试", null);
	
	return super.didFinishLaunching(application, launchOptions);
}
 
开发者ID:tianqiujie,项目名称:robovm-ios-bindings,代码行数:29,代码来源:IOSLauncher.java


示例10: didFinishLaunching

import org.robovm.apple.foundation.NSDictionary; //导入依赖的package包/类
@Override
public boolean didFinishLaunching(UIApplication application, NSDictionary launchOptions) {

    Thread launchThread = new Thread() {
        @Override
        public void run() {
            Application.launch(JavaFXAddressBook.class);
        }
    };
    launchThread.setDaemon(true);
    launchThread.start();

    return true;
}
 
开发者ID:Kourtessia,项目名称:JavaFX-for-iOS,代码行数:15,代码来源:RoboVMMain.java


示例11: didFinishLaunching

import org.robovm.apple.foundation.NSDictionary; //导入依赖的package包/类
@Override
public boolean didFinishLaunching(UIApplication application,
		NSDictionary<NSString, ?> launchOptions) {
	super.didFinishLaunching(application, launchOptions);
	showAds();
	
	return true;
}
 
开发者ID:pierotofy,项目名称:snappyfrog,代码行数:9,代码来源:RobovmLauncher.java


示例12: getCellForRow

import org.robovm.apple.foundation.NSDictionary; //导入依赖的package包/类
@Override
public UITableViewCell getCellForRow(UITableView tableView, NSIndexPath indexPath) {
    UITableViewCell cell = tableView.dequeueReusableCell("cell");

    NSDictionary<NSString, ?> data = friends.get(indexPath.getRow());
    String id = data.get(new NSString("id")).toString();
    boolean installed = ((NSNumber) data.get(new NSString("installed"))).intValue() == 1;
    String name = data.get(new NSString("name")).toString();

    cell.getTextLabel().setText(String.format("%s (%s)", name, id));
    cell.getDetailTextLabel().setText(installed ? "App User" : "No App User");

    return cell;
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:15,代码来源:FriendsViewController.java


示例13: convertStringMapToDictionary

import org.robovm.apple.foundation.NSDictionary; //导入依赖的package包/类
private NSDictionary<NSString, NSString> convertStringMapToDictionary(Map<String, String> map) {
    NSDictionary<NSString, NSString> result = new NSMutableDictionary<>();
    if (map != null) {
        for (Map.Entry<String, String> entry : map.entrySet()) {
            result.put(new NSString(entry.getKey()), new NSString(entry.getValue()));
        }
    }
    return result;
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:10,代码来源:FacebookHandler.java


示例14: getImageSize

import org.robovm.apple.foundation.NSDictionary; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private static CGSize getImageSize(int index) {
    NSDictionary<NSString, NSObject> info = (NSDictionary<NSString, NSObject>) getImageData().get(index);
    float width = Float.valueOf(info.get(new NSString("width")).toString());
    float height = Float.valueOf(info.get(new NSString("height")).toString());
    return new CGSize(width, height);
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:8,代码来源:ImageScrollView.java


示例15: updateImage

import org.robovm.apple.foundation.NSDictionary; //导入依赖的package包/类
private void updateImage() {
    lastImageViewSize = imageView.getBounds().getSize();

    double scale = UIScreen.getMainScreen().getScale();
    CGSize targetSize = new CGSize(imageView.getBounds().getWidth() * scale, imageView.getBounds().getHeight()
            * scale);

    PHImageRequestOptions options = new PHImageRequestOptions();

    // Download from cloud if necessary
    options.setNetworkAccessAllowed(true);
    options.setProgressHandler(new VoidBlock4<Double, NSError, BooleanPtr, NSDictionary<?, ?>>() {
        @Override
        public void invoke(final Double progress, NSError error, BooleanPtr c, NSDictionary<?, ?> d) {
            DispatchQueue.getMainQueue().async(new Runnable() {
                @Override
                public void run() {
                    progressView.setProgress(progress.floatValue());
                    progressView.setHidden(progress <= 0 || progress >= 1);
                };
            });
        }
    });
    PHImageManager.getDefaultManager().requestImageForAsset(asset, targetSize, PHImageContentMode.AspectFill,
            options,
            new VoidBlock2<UIImage, PHImageRequestResult>() {
                @Override
                public void invoke(final UIImage result, PHImageRequestResult info) {
                    if (result != null) {
                        imageView.setImage(result);
                    }
                }
            });
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:35,代码来源:AAPLAssetViewController.java


示例16: accessGrantedForAddressBook

import org.robovm.apple.foundation.NSDictionary; //导入依赖的package包/类
/**
 * This method is called when the user has granted access to their address
 * book data.
 */
private void accessGrantedForAddressBook() {
    // Load data from the plist file
    String plistPath = NSBundle.getMainBundle().findResourcePath("Menu", "plist");
    menuArray = (NSArray<NSDictionary<NSString, NSString>>) NSArray.read(new File(plistPath));
    getTableView().reloadData();
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:11,代码来源:QuickContactsViewController.java


示例17: ShortcutsTableViewController

import org.robovm.apple.foundation.NSDictionary; //导入依赖的package包/类
public ShortcutsTableViewController(NSCoder coder) {
    super(coder);
    NSDictionary<NSString, ?> info = NSBundle.getMainBundle().getInfoDictionary(); // TODO
                                                                                   // we
                                                                                   // could
                                                                                   // wrap
                                                                                   // it
    // Obtain the UIApplicationShortcutItems array from the Info.plist. If
    // unavailable, there are no static shortcuts.
    @SuppressWarnings("unchecked") NSArray<NSDictionary<NSString, ?>> shortcuts = (NSArray<NSDictionary<NSString, ?>>) info
            .get("UIApplicationShortcutItems");
    if (shortcuts == null) {
        staticShortcuts = new NSArray<>();
    } else {
        staticShortcuts = new NSMutableArray<>();
        for (NSDictionary<NSString, ?> shortcut : shortcuts) {
            String shortcutType = shortcut.getString("UIApplicationShortcutItemType");
            String shortcutTitle = shortcut.getString("UIApplicationShortcutItemTitle");

            String localizedTitle = NSBundle.getMainBundle().getLocalizedInfoDictionary()
                    .getString(shortcutTitle, null);
            if (localizedTitle != null) {
                shortcutTitle = localizedTitle;
            }

            String shortcutSubtitle = shortcut.getString("UIApplicationShortcutItemSubtitle", null);
            if (shortcutSubtitle != null) {
                shortcutSubtitle = NSBundle.getMainBundle().getLocalizedInfoDictionary()
                        .getString(shortcutSubtitle, null);
            }

            staticShortcuts.add(new UIApplicationShortcutItem(shortcutType, shortcutTitle, shortcutSubtitle, null,
                    null));
        }
    }
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:37,代码来源:ShortcutsTableViewController.java


示例18: didFinishLaunching

import org.robovm.apple.foundation.NSDictionary; //导入依赖的package包/类
@Override
public boolean didFinishLaunching(UIApplication application, UIApplicationLaunchOptions launchOptions) {
    // Override point for customization after application launch.
    boolean shouldPerformAdditionalDelegateHandling = true;

    // If a shortcut was launched, display its information and take the
    // appropriate action
    if (launchOptions != null) {
        launchedShortcutItem = launchOptions.getShortcutItem();
    }

    // This will block "performActionForShortcutItem:completionHandler" from
    // being called.
    shouldPerformAdditionalDelegateHandling = false;

    // Install initial versions of our two extra dynamic shortcuts.
    NSArray<UIApplicationShortcutItem> shortcutItems = application.getShortcutItems();
    if (shortcutItems == null || shortcutItems.isEmpty()) {
        // Construct the items.
        UIApplicationShortcutItem shortcut3 = new UIMutableApplicationShortcutItem(SHORTCUT_THIRD, "Play");
        shortcut3.setLocalizedSubtitle("Will Play an item");
        shortcut3.setIcon(new UIApplicationShortcutIcon(UIApplicationShortcutIconType.Play));
        NSDictionary<NSString, ?> info3 = new NSMutableDictionary<>();
        info3.put(APPLICATION_SHORTCUT_USER_INFO_ICON_KEY, UIApplicationShortcutIconType.Play.ordinal());
        shortcut3.setUserInfo(info3);

        UIApplicationShortcutItem shortcut4 = new UIMutableApplicationShortcutItem(SHORTCUT_FOURTH, "Pause");
        shortcut4.setLocalizedSubtitle("Will Pause an item");
        shortcut4.setIcon(new UIApplicationShortcutIcon(UIApplicationShortcutIconType.Pause));
        NSDictionary<NSString, ?> info4 = new NSMutableDictionary<>();
        info4.put(APPLICATION_SHORTCUT_USER_INFO_ICON_KEY, UIApplicationShortcutIconType.Pause.ordinal());
        shortcut4.setUserInfo(info4);

        // Update the application providing the initial 'dynamic' shortcut
        // items.
        application.setShortcutItems(new NSArray<>(shortcut3, shortcut4));
    }

    return shouldPerformAdditionalDelegateHandling;
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:41,代码来源:ApplicationShortcuts.java


示例19: AtomicElement

import org.robovm.apple.foundation.NSDictionary; //导入依赖的package包/类
public AtomicElement(NSDictionary<NSString, NSObject> data) {
    atomicNumber = data.getInt("atomicNumber");
    atomicWeight = data.getString("atomicWeight");
    discoveryYear = data.getString("discoveryYear");
    radioactive = Boolean.valueOf(data.getString("radioactive"));
    name = data.getString("name");
    symbol = data.getString("symbol");
    state = data.getString("state");
    group = data.getInt("group");
    period = data.getInt("period");
    vertPos = data.getInt("vertPos");
    horizPos = data.getInt("horizPos");
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:14,代码来源:AtomicElement.java


示例20: IAPStoreProductViewController

import org.robovm.apple.foundation.NSDictionary; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public IAPStoreProductViewController() {
    getNavigationItem().setTitle("Store");

    // Create a store product view controller
    storeProductViewController = new SKStoreProductViewController();
    storeProductViewController.setDelegate(this);

    // Fetch all the products
    String plistPath = NSBundle.getMainBundle().findResourcePath("Products", "plist");
    NSArray<NSDictionary<NSString, NSObject>> temp = (NSArray<NSDictionary<NSString, NSObject>>) NSArray
            .read(new File(
                    plistPath));

    for (NSDictionary<NSString, NSObject> item : temp) {
        // Create an Product object to store its category, title, and
        // identifier properties
        Product product = new Product(item);

        // Keep track of all the products
        myProducts.add(product);
    }

    UITableView tableView = new UITableView(UIScreen.getMainScreen().getBounds(), UITableViewStyle.Grouped);
    tableView.registerReusableCellClass(UITableViewCell.class, "productID");
    setTableView(tableView);
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:28,代码来源:IAPStoreProductViewController.java



注:本文中的org.robovm.apple.foundation.NSDictionary类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TileDao类代码示例发布时间:2022-05-23
下一篇:
Java ComponentFactoryRegistrar类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap