2013-02-12 92 views
-8

看看这个&让我知道你们认为是错误的。 非常感谢。 :)xCode iOS Dev - 解析问题:预期标识符?

Image

+2

请张贴代码为文本,而不是作为截图。 – 2013-02-12 18:04:12

+0

如果([[可达性(ID)] currentReachabilityStatus] == NotReachable) { \t \t UIAlertView中* AV = [[[UIAlertView中的alloc] \t \t \t \t \t \t \t initWithTitle:@ “对不起” \t \t \t \t \t \t \t消息:@“你没有连接到互联网,请重试” \t \t \t \t \t \t \t代表:无 \t \t \t \t \t \t \t cancelButtonTitle:@ “OK” \t \t \t \t \t \t \t otherButtonTitles:无]自动释放]。 \t \t [av setDelegate:self]; \t \t [av show]; \t} – PsychedelicFuzz 2013-02-12 18:05:54

+0

如何让我的代码显得更清晰?我是这个网站的新手,非常需要帮助。 – PsychedelicFuzz 2013-02-12 18:06:23

回答

0

这里你写的类型(ID)&不写这个(ID)的任何标识,这就是为什么它总是给error.compiler除了数据类型后标识符。

它应该是唯一的

[reachability currentReachabilityStatus]; 
0

试试这个:

if([[Reachability reachabilityForInternetConnection] currentReachabilityStatus] == NotReachable) 

,或者在明确的方式

- (BOOL)connected 
{ 
    Reachability *reachability = [Reachability reachabilityForInternetConnection]; 
    NetworkStatus networkStatus = [reachability currentReachabilityStatus]; 
    return !(networkStatus == NotReachable); 
} 

而不是

if([[Rechability (id)] currentRechabilityStatus] == NotRechable) 

if(![self connected])