开发者

iPhone: chat view with buttons with different be behaviours

in my chat view user can send text message, location or an image. Location and image are represented by a UIBUtton. How can handle informations about the image or location to show in the selector's function?

i'm using this code to add an action on each button:

[locationButton addTarget:self action:@selector(seeUserLocation:) forControlEvents:UIControlEventTouchUpInside];

[imageButton addTarget:self action:@selector(seeUserImage:) forControlEvents:UIControlEventTouchUpInside];

How can 开发者_开发问答I handle information about the image's URL or about the location to show?


You will have to do it from code. You cannot pass arguments from IB.

So when a user picks a photo you should store the url in an ivar. Then when a user presses the button and calls the function seeUserImage you get the url from that ivar.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜