UIActionSheet 传值

#pragma mark - actionSheet

- (void)shareOrder:(NSDictionary *)product

{

UIActionSheet *as = [[UIActionSheet alloc] initWithTitle:VIMILocalizedString(@"分享", nil) delegate:self cancelButtonTitle:VIMILocalizedString(@"取消", nil) destructiveButtonTitle:nil otherButtonTitles:

@"分享给微信好友",

@"分享给QQ好友",

@"晒单到QQ空间" ,  nil];

objc_setAssociatedObject(as, @"product", product, OBJC_ASSOCIATION_RETAIN);

[as showInView:self.view];

}

- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {

NSDictionary *product = objc_getAssociatedObject(actionSheet, @"product");

}

时间: 2024-08-28 10:37:04

UIActionSheet 传值的相关文章

ios-私人通讯录 页面间的跳转和传值

这个demo 有多个页面 并涉及顺传和逆传 而且还有一个第三方库的导入 来实现自定义提示消息的特效 利用代理来实现页面间的传值 一个页面代表一个controller 这次  ViewController  反而一句代码都没写 // // HMContact.h // 私人通讯录 // // Created by YaguangZhu on 15/9/6. // Copyright (c) 2015年 YaguangZhu. All rights reserved. // #import <Fou

UIActionSheet底部弹出框

<底部弹出框来提示用户信息>    1.遵循代理方法<UIActionSheetDelete>    2.调用放法 [UIActionSheet *sheet=[UIActionSheet alloc]initWithTitle:@“通关了!” delegate:self cancelButtonTitle:@“取消” destructiveButtonTitle:@“购买” otherButtonTitles:@“购买1”,@“购买2”,nil]    [sheet showIn

JS 传值 传址

在JS中,有两种不同的方式可以操作数据的值,这两种技术分别叫做 传值 和 传址. 传值:在赋值过程中,首先对值进行了一份拷贝,而后将这份拷贝存储到一个变量.对象属性或数组元素中.拷贝的值和原始的值是完全独立.互不影响的.当一份数据通过值传递给一个函数,实际上被传递的不是数据本身,而是数据的一份拷贝.因此,如果函数修改了这个值,影响到的只是数据的那份拷贝,而并不影响数据本身. 传址:在赋值过程中,变量实际上存储的是数据的地址(对数据的引用),而不是原始数据或者是数据的拷贝.如果值通过一个地址发生了

Swift代理和传值

第一个视图控制器: import UIKit // 遵循协议 class ViewController: UIViewController,SecondVCDelegate { override func viewDidLoad() { super.viewDidLoad() // 创建一个button let button1 = UIButton(frame: CGRectMake(120, 120, 50, 50)) // 修改背景颜色 button1.backgroundColor = U

iOS pop使用通知传值

iOS pop回父级页面,使用通知传值 输入所要发送的信息 ,同时将label的值通过button方法调用传递, - (IBAction)buttonClick:(id)sender { //添加 字典,将label的值通过key值设置传递 NSDictionary *dict =[[NSDictionary alloc]initWithObjectsAndKeys:self.textFieldOne.text,@"textOne",self.textFieldTwo.text,@&q

iOS之页面传值

页面之间的传值方式 设有firstView和secondView两个视图 属性传值(适用于页面之间的正向传值) 1.在要显示信息的页面,创建属性 2.在要传值的页面,设置属性值 3.在显示信息的页面的ViewdidLoad方法中,接收属性值 代理传值(适用于页面之间的反向传值) 1.创建协议及协议方法,在反向传值的页面(secondVC)中 2.创建协议类型的属性,   在secondVC中创建属性 3.调用属性  即delegate,在secondVC页面中的对象传值的方法中调用[self.d

iOS中多视图的传值 属性传值和代理传值

首先创建两个类 ,FirstViewController和SecondViewController,都继承于UIViewController 1 #import "AppDelegate.h" 2 #import "FirstViewController.h" 3 4 @interface AppDelegate () 5 6 @end 7 8 @implementation AppDelegate 9 10 11 - (BOOL)application:(UIAp

JQuery ajax 在aspx中传值和取值

传值:ajax中的data(json)  js代码: <script type="text/javascript"> $(function () { $("#btnAddNews").bind("click", function () { var _name= $.trim($("#txtNewTitle").val()); $.ajax({ type: "POST", url: "A

iOS学习-UIActionSheet详解

1 // 2 // ViewController.m 3 // UIActionSheet详解 4 // 5 // Created by 大欢 on 16/1/25. 6 // Copyright © 2016年 bjsxt. All rights reserved. 7 // 8 9 #import "ViewController.h" 10 11 @interface ViewController ()<UIActionSheetDelegate> 12 13 - (I