Check this out & let me know what you guys think is wrong. Thank you very much. :)
Asked
Active
Viewed 1,693 times
-8

Chris Morgan
- 86,207
- 24
- 208
- 215

PsychedelicFuzz
- 17
- 7
-
2Please post the code as text rather than as a screenshot. – Chris Morgan Feb 12 '13 at 18:04
-
if([[Reachability (id)] currentReachabilityStatus] == NotReachable) { UIAlertView *av = [[[UIAlertView alloc] initWithTitle:@"Sorry" message:@"You are not connected to the internet. Please Try again" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] autorelease]; [av setDelegate:self]; [av show]; } – PsychedelicFuzz Feb 12 '13 at 18:05
-
How do I make my code appear any clearer? I am new to this site & desperately need help. – PsychedelicFuzz Feb 12 '13 at 18:06
-
From outside I have a feeling you are missing 'CFNetwork.framework' and 'System.Configuration' framework. – Reno Jones Feb 12 '13 at 18:06
-
The "Reachability.h" is imported at the start of the file. – PsychedelicFuzz Feb 12 '13 at 18:07
-
3@PsychedelicFuzz: please read the [editing help](http://stackoverflow.com/editing-help); such content belongs in the question rather than comments. – Chris Morgan Feb 12 '13 at 18:10
-
yes sir. you got it :) – PsychedelicFuzz Feb 12 '13 at 18:12
2 Answers
0
Try this:
if([[Reachability reachabilityForInternetConnection] currentReachabilityStatus] == NotReachable)
OR, In clear way
- (BOOL)connected
{
Reachability *reachability = [Reachability reachabilityForInternetConnection];
NetworkStatus networkStatus = [reachability currentReachabilityStatus];
return !(networkStatus == NotReachable);
}
Instead of
if([[Rechability (id)] currentRechabilityStatus] == NotRechable)
Put
if(![self connected])

Guru
- 21,652
- 10
- 63
- 102
0
here you have written type (id) & not written any identifier for this (id), thats why it is giving error.compiler always except identifier after the data type.
it should be only
[reachability currentReachabilityStatus];

Ravindra Bagale
- 17,226
- 9
- 43
- 70