it works with no problems:
h file:
- (BOOL) trytoGETURL;
m file
- (BOOL) trytoGETURL {
/ some code here ...
if ([response statusCode] == 200)
return YES;
else
return NO;
}
- (IBAction)ButtonTouchUp:(id)sender {
NSLog(@"button clicked");
if ( [self trytoGETURL]) {
NSLog(@"ok");
} else NSLog(@"problem");
but this crashes:
h file
- (BOOL) trytoGETURL:(NSString *) baseurl Redvalue:(int)red
GreenValue:(int)green BlueValue: (int) blue;
m file
- (BOOL) trytoGETURL:(NSString *) baseurl Redvalue:(int)red
GreenValue:(int)green BlueValue: (int) blue {
if ([response statusCode] == 200)
return YES;
else
return NO;
}
- (IBAction)ButtonTouchUp:(id)sender {
NSLog(@"button clicked");
if ( [self trytoGETURL:@"sd" Redvalue:100 Greenvalue:100 Bluevalue:100]) {
NSLog(@"est takaya stranica");
} else NSLog(@"net takoi stranica");
Xcode also writes: instance method not found!??
and by the way it doesn’t help me with when I’m starting to write like usual, why is it so?
it was just a problem with suntax.
trytoGETURL:(NSString *) baseurl– is wrong,trytoGETURL:(NSString *)baseurlis right. – no space needed.