【代码札记】点击任何处,出现城市

【代码笔记】点击任何处,出现城市

一,效果图。

【代码札记】点击任何处,出现城市

二,工程目录。

【代码札记】点击任何处,出现城市

三,代码。

【代码札记】点击任何处,出现城市
//点击任何处,出现城市
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    UIActionSheet *city=[[UIActionSheet alloc] initWithTitle:@"城市选择" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:@"北京",@"上海",@"天津",@"重庆",@"哈尔滨",@"长春",@"沈阳",@"呼和浩特",@"石家庄",@"乌鲁木齐",@"兰州",@"西安",@"西宁",@"银川",@"郑州",@"济南",@"太原",@"合肥",@"武汉",@"南京",@"成都",@"贵阳",@"昆明",@"南宁",@"拉萨",@"杭州",@"南昌",@"广州",@"福州",@"台北",@"海口",@"香港",@"澳门", nil];
    city.backgroundColor=[UIColor orangeColor];
    [city showInView:self.view];
    
}
【代码札记】点击任何处,出现城市