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.
精彩评论