Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jalju

macrumors newbie
Original poster
-(void) mymethod{
UIButton *refreshbutton=[UIButton buttonWithType:UIButtonTypeCustom];
[refreshbutton setFrame:CGRectMake(15.0f, 330.0f, 150.0f, 32.0f)];
NSString *myvalue=[[NSString alloc]initWithString😡"YES IT IS OKy |"];
[refreshbutton setTitle😡"Refresh" forState:UIControlStateNormal];
[refreshbutton addTarget:self action😡selector(showvalue: myvalue) forControlEvents:UIControlEventTouchUpInside];
[self.window addSubview:refreshbutton];
}

-(void) showvalue🙁id)sender{

// here how to displs the value of "myvalue" ? myvalue is define in mymethod . i mean first method..
}

pls rectify the error in this code...
 
1) please use code-tags in this forum
2) I think spaces are not allowed in selectors. also, I can't imaginge
[[NSString alloc]init
is working without a space, but I havn't tried.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.