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

AbhishekApple

macrumors member
Original poster
Aug 5, 2010
86
0
NSString variable is not accepting value ( ==> Arrow specifies breakpoint)

Code:
-(IBAction)btnLoginGoClicked:(id)sender
{
		NSString *userid =txtUserId.text;  //==>on breakpoint while debugging  value shown by userid is "abcd"
		NSString *pass = txtPassword.text; //==>on breakpoint  while debugging  value shown by pass is "yyy"	
		
		NSString *loginurl= [[NSString alloc] initWithFormat:@"http://abc.com/email=%@&password=%@" ,userid,pass];  
		
		//==>on breakpoint while debugging  value shown by loginurl is  NSString* loginurl <variable nil
	
		NSURL *url = [NSURL URLWithString:loginurl];
		ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
		[loginurl release];
		[request setDelegate:self];
		[request startAsynchronous];
}
if i keep only starting 2 lines then the value of text field are not accepted at all but their is no error and execution continues..
but when i print breakpoint in gdb it shows following error description
Printing description of loginurl:
A syntax error in expression, near `variable)'.
A syntax error in expression, near `variable)'.

Also, if i replace the following same error exists
Code:
//Replace ==>

NSString *loginurl= [[NSString alloc] initWithFormat:@"http://abc.com/email=%@&password=%@" ,userid,pass];  
		
//with ==>

NSString *loginurl=@"test";

Same code runs in other project
 
Hi , Did you got any work around for this.

Please share the resolution

Try to print variables value using nslog if it gives required output thn thr shldn't b any problem working with same code....

else check with value assigning of strings (memory allocation)..
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.